Home > General > System.configuration.configurationexception[]


Resolution As this application is built using VS .NET 2005 or 2008, the application directory must be configured to use framework 2.0.See Microsoft Kbase 909642 Keywords KBA , BI-DEV-NET , BI Return to top Property: Source (read-write) InheritedSee base class member description: System.Exception.Source Summary Gets or sets the name of the application or the object that causes the error. By default, the stack trace is captured immediately before an exception object is thrown. Section=ResponseStatusLine2CS0246 and CS0433 errors when building .NET 4.0 website on Server 2012-2Windows Server 2012 SQL Server 2012 and .NET Framework 4.00.Net Framework 4.0 Compatiblity with Windows Server 20124.NET 4.0 Project will http://colinmeldrum.com/general/system-stackoverflowexception.html

share|improve this answer answered May 5 '09 at 12:11 Laurent 7111 add a comment| up vote 4 down vote The ConfigurationElement class (which is the base class of many config-related classes, Thanks in advance, Chris Reply swall None 0 Points 28 Posts Re: Encountering "System.Configuration.ConfigurationException" Sep 24, 2003 11:40 AM|swall|LINK anything crazy in your web.config file? Learning resources Microsoft Virtual Academy Channel 9 MSDN Magazine Community Forums Blogs Codeplex Support Self support Programs BizSpark (for startups) Microsoft Imagine (for students) United States (English) Newsletter Privacy & cookies For example, the ArgumentException class implements ToString so that it returns the value of the ParamName property, if that value is not a null reference.

If you do decide to use existing exceptions, you don't absolutely have to follow the documentation to the letter. Aligning texts side by side with equations in \align environment What are some counter-intuitive results in mathematics that involve only finite objects? Success! Initializes a new instance of the ConfigurationErrorsException class." –Oleg Sh Feb 17 at 19:58 add a comment| up vote 7 down vote What about System.Configuration.SettingsPropertyNotFoundException?

the redeclaration of the or redeclaration of appSettings could have done it. ‹ Previous Thread|Next Thread › This site is managed for Microsoft by Neudesic, LLC. | © 2016 Microsoft. The default implementation of Exception.ToString obtains the name of the class that threw the current exception, the message, the result of calling ToString on the inner exception, and the result of Where the exception contains culture-sensitive data, the string representation returned by ToString is required to take into account the current system culture. It's your application- as long as you document it and clearly indicate the exception that will be thrown in the specific case of a missing configuration value, you can use any

Am I being a "mean" instructor, denying an extension on a take home exam BASH copy to another directory not working split strings and add them as new row Bounce off Thank You very much! ConfigurationException(String, Exception)Obsolete. Return to top Overloaded ctor #5 Summary Initializes a new instance of the ConfigurationException with the specified error message and the name of the configuration section containing the error.

Initializes a new instance of the ConfigurationException class. This constructor is called by derived class constructors to initialize state in this type. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed When managed code throws an exception, the runtime passes the HRESULT to the COM client.

Gets an extended description of why this configuration exception was thrown.Public Methodsoverride GetObjectData(SerializationInfo, StreamingContext)Sets the SerializationInfo object with the file name and line number at which this configuration exception occurred.static GetXmlNodeFilename(XmlNode) If the settings aren't in it (where they're encrypted), the application can't continue, and must terminate. Inner Exception is MyAppException: ExceptExample inner exception at ExceptExample.ThrowInner() at ExceptExample.CatchInner() Return to top Property: Line (read-only) Summary Gets the number of the line where the error occurred. UPDATE: I agree with the comments, so I have changed the subclass to ConfigurationErrorsException from Exception.

Edit Addenda Some have asked whether or not I could provide a default value, and continue. up vote 29 down vote Personally, I'd use InvalidOperationException, as it's a problem with the object state - not the configuration system. For example, the HelpLink value could be: "file:///C:/Applications/Bazzal/help.html#ErrorNum42" Return to top Property: HResult (read-write) InheritedSee base class member description: System.Exception.HResult Summary Gets or sets HRESULT, a coded numerical value that is Return to top Method: MemberwiseClone() InheritedSee base class member description: System.Object.MemberwiseClone C# Syntax: protected objectMemberwiseClone(); For more information on members inherited from System.Object click on the link above. Return

Join them; it only takes a minute: Sign up .NET: Which Exception to Throw When a Required Configuration Setting is Missing? protected ConfigurationException(SerializationInfo info, StreamingContext context) : base(info, context) { Init(info.GetString("filename"), info.GetInt32("line")); } [Obsolete("This class is obsolete, to create a new exception create a System." + "Configuration!System.Configuration.ConfigurationErrorsException")] public ConfigurationException() : this(null, null, Caught: Error caused by trying ThrowInner. http://colinmeldrum.com/general/system-unauthorizedaccessexception.html Both applies here. –Andreas Huber Jan 6 '09 at 17:12 1 You missed something: "when an application configuration setting is missing or contains an invalid value", that's not the same

ConfigurationException(String, String, Int32)Initializes a new instance of the ConfigurationException class. Yes No Additional feedback? 1500 characters remaining Submit Skip this Thank you! ConfigurationException(String, Exception, XmlNode)Initializes a new instance of the ConfigurationException class.

Buy at Amazon US or Buy at Amazon UK PropertyEmitter.cs RoleManagerEventArgs.cs WebPartMinimizeVerb.cs AsyncContentLoadedEventArgs.cs BindingGroup.cs OracleParameterBinding.cs WindowsTreeView.cs AssociationTypeEmitter.cs DocumentationServerProtocol.cs ZipIOModeEnforcingStream.cs IndividualDeviceConfig.cs RemotingConfiguration.cs BaseTemplateBuildProvider.cs ConsoleTraceListener.cs StrokeNodeEnumerator.cs XmlSerializerFactory.cs DataRowCollection.cs webproxy.cs DataColumnCollection.cs CalendarDateRange.cs Activity.cs DbProviderServices.cs

Each exception is mapped to a distinct HRESULT. Message Read-onlyOverridden: Gets a string containing the concatenated file name and line number of the error. Does anyone have an ideas or clues as to what could be happening. Remarks A constructor that accepts an XmlNode argument should always be used when reporting errors thrown by configuration section handlers.

Hmm... It's quick & easy. The documentation will describe how the framework uses a given exception, but doesn't imply any limitation on how you choose to use/reuse an existing exception. http://colinmeldrum.com/general/system-termservdevices-1111-error24.html Caught: {0}", e.Message); Console.WriteLine ("Inner Exception is {0}",e.InnerException); } } } This code has the following output: In Main catch block.

Unless you have a scenario for catching your custom exception, unlikely in the case of a configuration error, it's better to reuse an existing Type (ConfigurationErrorsException). The ConfigurationErrorsException object replaces it for the configuration system. This API supports the product infrastructure and is not intended to be used directly from your code. share|improve this answer answered Jan 6 '09 at 16:32 Mark Brackett 64.4k1278126 I've opted for InvalidOperationException, as it is handled by the ASP.NET Page protected OnError method, whilst ConfigurationErrorsException

If you do want a very specific indication of a missing value, you might consider writing your own ConfigurationSettingMissing exception: [Serializable] public class ConfigurationMissingException : ConfigurationErrorsException {} EDIT: Writing your own C# Syntax: public virtual stringSource {get; set;} Remarks If Exception.Source is not set, the name of the assembly where the exception originated is returned. So far, the test has run for over a day without encountering a System.Configuration.ConfigurationException. See Also: SystemExceptionPublic ConstructorsConfigurationException()Initializes a new instance of the ConfigurationException class.

C# Syntax: public ConfigurationException(
Parameters: message The message to display to the client when the exception is thrown. You’ll be auto redirected in 1 second. .NET Framework Class Library System.Configuration Namespaces System.Configuration System.Configuration ConfigurationException Class ConfigurationException Class ConfigurationException Class ApplicationScopedSettingAttribute Class ApplicationSettingsBase Class ApplicationSettingsGroup Class AppSettingsReader Class AppSettingsSection Class This API supports the product infrastructure and is not intended to be used directly from your code. However, for certain settings, this won't apply.

For example in the console app I have just 2 following lines - class Program { static void Main(string[] args) { var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var abc = ConfigurationManager.AppSettings["abc"]; } } Return Value: The name of the configuration file.