ConfigurationErrorsException クラス
アセンブリ: System.Configuration (system.configuration.dll 内)

[SerializableAttribute] public ref class ConfigurationErrorsException : public ConfigurationException


カスタム セクションを作成し、そのプロパティの変更時に ConfigurationErrorsException 例外を生成するコード例を次に示します。
Imports System Imports System.Configuration Imports System.Collections.Specialized Imports System.Collections ' Define a custom section. NotInheritable Public Class CustomSection Inherits ConfigurationSection Public Sub New() End Sub 'New <ConfigurationProperty("fileName", DefaultValue:="default.txt", IsRequired:=True, IsKey:=False), StringValidator(InvalidCharacters:=" ~!@#$%^&*()[]{}/;'""|\", MinLength:=1, MaxLength:=60)> _ Public Property FileName() As String Get Return CStr(Me("fileName")) End Get Set(ByVal value As String) Me("fileName") = value End Set End Property <ConfigurationProperty("maxUsers", DefaultValue:=10, IsRequired:=False), LongValidator(MinValue:=1, MaxValue:=100, ExcludeRange:=False)> _ Public Property MaxUsers() As Long Get Return Fix(Me("maxUsers")) End Get Set(ByVal value As Long) Me("maxUsers") = value End Set End Property End Class 'CustomSection ' Create the custom section and write it to ' the configuration file. Class UsingConfigurationErrorsException ' Create a custom section. Shared Sub New() ' Get the application configuration file. Dim config _ As System.Configuration.Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None) ' If the section does not exist in the configuration ' file, create it and save it to the file. If config.Sections("CustomSection") Is Nothing Then Dim custSection As New CustomSection() config.Sections.Add("CustomSection", custSection) custSection = config.GetSection("CustomSection") custSection.SectionInformation.ForceSave = True config.Save(ConfigurationSaveMode.Full) End If End Sub 'New ' Modify a custom section and cause configuration ' error exceptions. Shared Sub ModifyCustomSection() Try ' Get the application configuration file. Dim config _ As System.Configuration.Configuration = _ ConfigurationManager.OpenExeConfiguration( _ ConfigurationUserLevel.None) Dim custSection _ As CustomSection = _ config.Sections("CustomSection") ' Change the section properties. custSection.FileName = "newName.txt" ' Cause an exception. custSection.MaxUsers = _ custSection.MaxUsers + 100 If Not custSection.ElementInformation.IsLocked Then config.Save() Else Console.WriteLine( _ "Section was locked, could not update.") End If Catch err As ConfigurationErrorsException Dim msg As String = err.Message Console.WriteLine("Message: {0}", msg) Dim fileName As String = err.Filename Console.WriteLine("Filename: {0}", _ fileName) Dim lineNumber As Integer = err.Line Console.WriteLine("Line: {0}", _ lineNumber.ToString()) Dim bmsg As String = err.BareMessage Console.WriteLine("BareMessage: {0}", bmsg) Dim src As String = err.Source Console.WriteLine("Source: {0}", src) Dim st As String = err.StackTrace Console.WriteLine("StackTrace: {0}", st) End Try End Sub 'ModifyCustomSection Shared Sub Main(ByVal args() As String) ModifyCustomSection() End Sub 'Main End Class 'UsingConfigurationErrorsException
using System; using System.Configuration; using System.Collections.Specialized; using System.Collections; namespace Samples.AspNet { // Define a custom section. public sealed class CustomSection : ConfigurationSection { public CustomSection() { } [ConfigurationProperty("fileName", DefaultValue = "default.txt" , IsRequired = true, IsKey = false)] [StringValidator(InvalidCharacters = " ~!@#$%^&*()[]{}/;'\"|\\" , MinLength = 1, MaxLength = 60)] public string FileName { get { return (string)this["fileName"]; } set { this["fileName"] = value; } } [ConfigurationProperty("maxUsers", DefaultValue = (long)10, IsRequired = false)] [LongValidator(MinValue = 1, MaxValue = 100, ExcludeRange = false)] public long MaxUsers { get { return (long)this["maxUsers"]; } set { this["maxUsers"] = value; } } } // Create the custom section and write it to // the configuration file. class UsingConfigurationErrorsException { // Create a custom section. static UsingConfigurationErrorsException() { // Get the application configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None); // If the section does not exist in the configuration // file, create it and save it to the file. if (config.Sections["CustomSection"] == null) { CustomSection custSection = new CustomSection(); config.Sections.Add("CustomSection", custSection); custSection = config.GetSection("CustomSection") as CustomSection; custSection.SectionInformation.ForceSave = true; config.Save(ConfigurationSaveMode.Full); } } // Modify a custom section and cause configuration // error exceptions. static void ModifyCustomSection() { try { // Get the application configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None); CustomSection custSection = config.Sections["CustomSection"] as CustomSection; // Change the section properties. custSection.FileName = "newName.txt"; // Cause an exception. custSection.MaxUsers = custSection.MaxUsers + 100; if (!custSection.ElementInformation.IsLocked) config.Save(); else Console.WriteLine( "Section was locked, could not update."); } catch (ConfigurationErrorsException err) { string msg = err.Message; Console.WriteLine("Message: {0}", msg); string fileName = err.Filename; Console.WriteLine("Filename: {0}", fileName); int lineNumber = err.Line; Console.WriteLine("Line: {0}", lineNumber.ToString()); string bmsg = err.BareMessage; Console.WriteLine("BareMessage: {0}", bmsg); string source = err.Source; Console.WriteLine("Source: {0}", source); string st = err.StackTrace; Console.WriteLine("StackTrace: {0}", st); } } static void Main(string[] args) { ModifyCustomSection(); } } }
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="CustomSection" type="Samples.AspNet.CustomSection, ConfigurationErrorsException, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" /> </configSections> <CustomSection fileName="default.txt" maxUsers="10" /> </configuration>

System.Exception
System.SystemException
System.Configuration.ConfigurationException
System.Configuration.ConfigurationErrorsException


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ ()
アセンブリ: System.Configuration (system.configuration.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ (String)
アセンブリ: System.Configuration (system.configuration.dll 内)


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ

名前 | 説明 |
---|---|
ConfigurationErrorsException () | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |
ConfigurationErrorsException (String) | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |
ConfigurationErrorsException (SerializationInfo, StreamingContext) | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |
ConfigurationErrorsException (String, Exception) | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |
ConfigurationErrorsException (String, XmlNode) | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |
ConfigurationErrorsException (String, XmlReader) | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |
ConfigurationErrorsException (String, Exception, XmlNode) | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |
ConfigurationErrorsException (String, Exception, XmlReader) | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |
ConfigurationErrorsException (String, String, Int32) | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |
ConfigurationErrorsException (String, Exception, String, Int32) | ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |

ConfigurationErrorsException コンストラクタ (SerializationInfo, StreamingContext)
アセンブリ: System.Configuration (system.configuration.dll 内)

Dim info As SerializationInfo Dim context As StreamingContext Dim instance As New ConfigurationErrorsException(info, context)
protected function ConfigurationErrorsException ( info : SerializationInfo, context : StreamingContext )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ (String, Exception)
アセンブリ: System.Configuration (system.configuration.dll 内)

Dim message As String Dim inner As Exception Dim instance As New ConfigurationErrorsException(message, inner)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ (String, XmlNode)
アセンブリ: System.Configuration (system.configuration.dll 内)

Dim message As String Dim node As XmlNode Dim instance As New ConfigurationErrorsException(message, node)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ (String, XmlReader)
アセンブリ: System.Configuration (system.configuration.dll 内)

Dim message As String Dim reader As XmlReader Dim instance As New ConfigurationErrorsException(message, reader)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ (String, Exception, XmlNode)
アセンブリ: System.Configuration (system.configuration.dll 内)

Dim message As String Dim inner As Exception Dim node As XmlNode Dim instance As New ConfigurationErrorsException(message, inner, node)
public function ConfigurationErrorsException ( message : String, inner : Exception, node : XmlNode )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ (String, Exception, XmlReader)
アセンブリ: System.Configuration (system.configuration.dll 内)

Dim message As String Dim inner As Exception Dim reader As XmlReader Dim instance As New ConfigurationErrorsException(message, inner, reader)
public function ConfigurationErrorsException ( message : String, inner : Exception, reader : XmlReader )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ (String, String, Int32)
アセンブリ: System.Configuration (system.configuration.dll 内)

Dim message As String Dim filename As String Dim line As Integer Dim instance As New ConfigurationErrorsException(message, filename, line)

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException コンストラクタ (String, Exception, String, Int32)
アセンブリ: System.Configuration (system.configuration.dll 内)

Public Sub New ( _ message As String, _ inner As Exception, _ filename As String, _ line As Integer _ )
Dim message As String Dim inner As Exception Dim filename As String Dim line As Integer Dim instance As New ConfigurationErrorsException(message, inner, filename, line)
public: ConfigurationErrorsException ( String^ message, Exception^ inner, String^ filename, int line )
public function ConfigurationErrorsException ( message : String, inner : Exception, filename : String, line : int )

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ConfigurationErrorsException プロパティ

名前 | 説明 | |
---|---|---|
![]() | BareMessage | オーバーライドされます。 この構成上の例外がスローされた理由の記述を取得します。 |
![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。 ( Exception から継承されます。) |
![]() | Errors | この ConfigurationErrorsException 例外がスローされた理由の詳細なエラーのコレクションを取得します。 |
![]() | Filename | オーバーライドされます。 この構成上の例外がスローされる原因となった構成ファイルのパスを取得します。 |
![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。 ( Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。 ( Exception から継承されます。) |
![]() | Line | オーバーライドされます。 この構成上の例外がスローされた構成ファイル内の行番号を取得します。 |
![]() | Message | オーバーライドされます。 この構成上の例外がスローされた理由の拡張された記述を取得します。 |
![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。 ( Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。 ( Exception から継承されます。) |
![]() | TargetSite | 現在の例外をスローするメソッドを取得します。 ( Exception から継承されます。) |


ConfigurationErrorsException メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 ( Exception から継承されます。) |
![]() | GetFilename | オーバーロードされます。 この構成上の例外がスローされたときに読み取られていた構成ファイルのパスを取得します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetLineNumber | オーバーロードされます。 この構成上の例外がスローされたときに処理されていた構成ファイル内の行番号を取得します。 |
![]() | GetObjectData | オーバーライドされます。 ファイル名とこの構成上の例外が発生した行番号を使用して、SerializationInfo オブジェクトを設定します。 |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 ( Exception から継承されます。) |
![]() | GetXmlNodeFilename | この構成上の例外がスローされたときに、内部 XmlNode オブジェクトの読み込み元であった構成ファイルのパスを取得します。 ( ConfigurationException から継承されます。) |
![]() | GetXmlNodeLineNumber | この構成上の例外がスローされたときに、内部 XmlNode オブジェクトが表していた構成ファイル内の行番号を取得します。 ( ConfigurationException から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 ( Exception から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

ConfigurationErrorsException メンバ
ConfigurationErrorsException データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | ConfigurationErrorsException | オーバーロードされます。 ConfigurationErrorsException クラスの新しいインスタンスを初期化します。 |


名前 | 説明 | |
---|---|---|
![]() | BareMessage | オーバーライドされます。 この構成上の例外がスローされた理由の記述を取得します。 |
![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。(Exception から継承されます。) |
![]() | Errors | この ConfigurationErrorsException 例外がスローされた理由の詳細なエラーのコレクションを取得します。 |
![]() | Filename | オーバーライドされます。 この構成上の例外がスローされる原因となった構成ファイルのパスを取得します。 |
![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。(Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。(Exception から継承されます。) |
![]() | Line | オーバーライドされます。 この構成上の例外がスローされた構成ファイル内の行番号を取得します。 |
![]() | Message | オーバーライドされます。 この構成上の例外がスローされた理由の拡張された記述を取得します。 |
![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。(Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。(Exception から継承されます。) |
![]() | TargetSite | 現在の例外をスローするメソッドを取得します。(Exception から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 (Exception から継承されます。) |
![]() | GetFilename | オーバーロードされます。 この構成上の例外がスローされたときに読み取られていた構成ファイルのパスを取得します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetLineNumber | オーバーロードされます。 この構成上の例外がスローされたときに処理されていた構成ファイル内の行番号を取得します。 |
![]() | GetObjectData | オーバーライドされます。 ファイル名とこの構成上の例外が発生した行番号を使用して、SerializationInfo オブジェクトを設定します。 |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 (Exception から継承されます。) |
![]() | GetXmlNodeFilename | この構成上の例外がスローされたときに、内部 XmlNode オブジェクトの読み込み元であった構成ファイルのパスを取得します。 (ConfigurationException から継承されます。) |
![]() | GetXmlNodeLineNumber | この構成上の例外がスローされたときに、内部 XmlNode オブジェクトが表していた構成ファイル内の行番号を取得します。 (ConfigurationException から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 (Exception から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からConfigurationErrorsExceptionを検索する場合は、下記のリンクをクリックしてください。

- ConfigurationErrorsExceptionのページへのリンク