15 private const string HTTP_PREFIX =
"http:";
17 private string _filename;
28 if (!
string.IsNullOrEmpty(filename))
50 public virtual string Filename => SafeFilename(_filename);
54 public virtual int Line => _line;
56 private void Init(
string filename,
int line)
58 base.HResult = -2146232062;
69 Init(info.GetString(
"filename"), info.GetInt32(
"line"));
73 [Obsolete(
"This class is obsolete, to create a new exception create a System.Configuration!System.Configuration.ConfigurationErrorsException")]
75 : this(null, null, null, 0)
81 [Obsolete(
"This class is obsolete, to create a new exception create a System.Configuration!System.Configuration.ConfigurationErrorsException")]
83 : this(message, null, null, 0)
90 [Obsolete(
"This class is obsolete, to create a new exception create a System.Configuration!System.Configuration.ConfigurationErrorsException")]
92 : this(message, inner, null, 0)
99 [Obsolete(
"This class is obsolete, to create a new exception create a System.Configuration!System.Configuration.ConfigurationErrorsException")]
109 [Obsolete(
"This class is obsolete, to create a new exception create a System.Configuration!System.Configuration.ConfigurationErrorsException")]
119 [Obsolete(
"This class is obsolete, to create a new exception create a System.Configuration!System.Configuration.ConfigurationErrorsException")]
121 : this(message, null, filename, line)
130 [Obsolete(
"This class is obsolete, to create a new exception create a System.Configuration!System.Configuration.ConfigurationErrorsException")]
132 : base(message, inner)
134 Init(filename, line);
143 base.GetObjectData(info, context);
144 info.AddValue(
"filename", _filename);
145 info.AddValue(
"line", _line);
151 [Obsolete(
"This class is obsolete, use System.Configuration!System.Configuration.ConfigurationErrorsException.GetFilename instead")]
154 return SafeFilename(GetUnsafeXmlNodeFilename(node));
160 [Obsolete(
"This class is obsolete, use System.Configuration!System.Configuration.ConfigurationErrorsException.GetLinenumber instead")]
163 return (node as IConfigErrorInfo)?.LineNumber ?? 0;
167 private static string FullPathWithAssert(
string filename)
169 string result =
null;
181 internal static string SafeFilename(
string filename)
183 if (
string.IsNullOrEmpty(filename))
211 string path = FullPathWithAssert(filename);
228 private static string GetUnsafeXmlNodeFilename(
XmlNode node)
230 IConfigErrorInfo configErrorInfo = node as IConfigErrorInfo;
231 if (configErrorInfo !=
null)
233 return configErrorInfo.Filename;
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Describes a set of security permissions applied to code. This class cannot be inherited.
FileIOPermissionAccess
Specifies the type of file access requested.
ConfigurationException(string message, XmlNode node)
Initializes a new instance of the T:System.Configuration.ConfigurationException class.
Serves as the base class for system exceptions namespace.
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
ConfigurationException(string message, Exception inner)
Initializes a new instance of the T:System.Configuration.ConfigurationException class.
static string GetFileName(string path)
Returns the file name and extension of the specified path string.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
ConfigurationException(string message, Exception inner, XmlNode node)
Initializes a new instance of the T:System.Configuration.ConfigurationException class.
virtual int Line
Gets the line number within the configuration file at which this configuration exception was thrown.
SecurityAction
Specifies the security actions that can be performed using declarative security.
virtual string BareMessage
Gets a description of why this configuration exception was thrown.
static int GetXmlNodeLineNumber(XmlNode node)
Gets the line number within the configuration file that the internal T:System.Xml....
static string GetXmlNodeFilename(XmlNode node)
Gets the path to the configuration file from which the internal T:System.Xml.XmlNode object was loade...
ConfigurationException(string message)
Initializes a new instance of the T:System.Configuration.ConfigurationException class.
override void GetObjectData(SerializationInfo info, StreamingContext context)
Sets the T:System.Runtime.Serialization.SerializationInfo object with the file name and line number a...
ConfigurationException(string message, string filename, int line)
Initializes a new instance of the T:System.Configuration.ConfigurationException class.
static string GetFullPath(string path)
Returns the absolute path for the specified path string.
override string Message
Gets an extended description of why this configuration exception was thrown.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
The exception that is thrown when a configuration system error has occurred.
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Specifies that the class can be serialized.
ConfigurationException()
Initializes a new instance of the T:System.Configuration.ConfigurationException class.
Provides information about a specific culture (called a locale for unmanaged code development)....
Controls the ability to access files and folders. This class cannot be inherited.
ConfigurationException(string message, Exception inner, string filename, int line)
Initializes a new instance of the T:System.Configuration.ConfigurationException class.
ConfigurationException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the T:System.Configuration.ConfigurationException class.
static bool IsPathRooted(string path)
Gets a value indicating whether the specified path string contains a root.
The exception that is thrown when a security error is detected.
Represents a single node in the XML document.
virtual string Filename
Gets the path to the configuration file that caused this configuration exception to be thrown.
Performs operations on T:System.String instances that contain file or directory path information....