MissingMethodException クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<SerializableAttribute> _ <ComVisibleAttribute(True)> _ Public Class MissingMethodException Inherits MissingMemberException Implements ISerializable
[SerializableAttribute] [ComVisibleAttribute(true)] public class MissingMethodException : MissingMemberException, ISerializable
[SerializableAttribute] [ComVisibleAttribute(true)] public ref class MissingMethodException : public MissingMemberException, ISerializable

通常、存在しないクラス メソッドにコードでアクセスしようとすると、コンパイル エラーが生成されます。MissingMethodException は、厳密な名前で参照されていないアセンブリの、名前変更または削除されたメソッドに動的にアクセスしようとした場合に対処するために用意されています。MissingMethodException は、変更されたアセンブリの存在しないメソッドに、従属するアセンブリのコードがアクセスしようとした場合にスローされます。
MissingMethodException は、値 0x80131513 を保持する HRESULT COR_E_MISSINGMETHOD を使用します。
MissingMethodException のインスタンスの初期プロパティ値の一覧については、MissingMethodException コンストラクタのトピックを参照してください。

この例では、リフレクションを使用して存在しないメソッドを呼び出そうとしたか、または存在しないフィールドにアクセスしようとした場合の動作を示します。このアプリケーションは、MissingMethodException、MissingFieldException、および MissingMemberException をキャッチして回復します。
using System; using System.Reflection; public class App { public static void Main() { try { // Attempt to call a static DoSomething method defined in the App class. // However, because the App class does not define this field, // a MissingFieldException is thrown. typeof(App).InvokeMember("DoSomething", BindingFlags.Static | BindingFlags.InvokeMethod, null, null, null); } catch (MissingMethodException e) { // Show the user that the DoSomething method cannot be called. Console.WriteLine("Unable to call the DoSomething method: {0}", e.Message); } try { // Attempt to access a static AField field defined in the App class. // However, because the App class does not define this field, // a MissingFieldException is thrown. typeof(App).InvokeMember("AField", BindingFlags.Static | BindingFlags.SetField, null, null, new Object[] { 5 }); } catch (MissingFieldException e) { // Show the user that the AField field cannot be accessed. Console.WriteLine("Unable to access the AField field: {0}", e.Message); } try { // Attempt to access a static AnotherField field defined in the App class. // However, because the App class does not define this field, // a MissingFieldException is thrown. typeof(App).InvokeMember("AnotherField", BindingFlags.Static | BindingFlags.GetField, null, null, null); } catch (MissingMemberException e) { // Notice that this code is catching MissingMemberException which is the // base class of MissingMethodException and MissingFieldException. // Show the user that the AnotherField field cannot be accessed. Console.WriteLine("Unable to access the AnotherField field: {0}", e.Message); } } } // This code produces the following output. // // Unable to call the DoSomething method: Method 'App.DoSomething' not found. // Unable to access the AField field: Field 'App.AField' not found. // Unable to access the AnotherField field: Field 'App.AnotherField' not found.
using namespace System; using namespace System::Reflection; ref class App { }; int main() { try { // Attempt to call a static DoSomething method defined in the App class. // However, because the App class does not define this field, // a MissingFieldException is thrown. App::typeid->InvokeMember("DoSomething", BindingFlags::Static | BindingFlags::InvokeMethod, nullptr, nullptr, nullptr); } catch (MissingMethodException^ ex) { // Show the user that the DoSomething method cannot be called. Console::WriteLine("Unable to call the DoSomething method: {0}", ex->Message); } try { // Attempt to access a static AField field defined in the App class. // However, because the App class does not define this field, // a MissingFieldException is thrown. App::typeid->InvokeMember("AField", BindingFlags::Static | BindingFlags::SetField, nullptr, nullptr, gcnew array<Object^>{5}); } catch (MissingFieldException^ ex) { // Show the user that the AField field cannot be accessed. Console::WriteLine("Unable to access the AField field: {0}", ex->Message); } try { // Attempt to access a static AnotherField field defined in the App class. // However, because the App class does not define this field, // a MissingFieldException is thrown. App::typeid->InvokeMember("AnotherField", BindingFlags::Static | BindingFlags::GetField, nullptr, nullptr, nullptr); } catch (MissingMemberException^ ex) { // Notice that this code is catching MissingMemberException which is the // base class of MissingMethodException and MissingFieldException. // Show the user that the AnotherField field cannot be accessed. Console::WriteLine("Unable to access the AnotherField field: {0}", ex->Message); } } // This code produces the following output. // // Unable to call the DoSomething method: Method 'App.DoSomething' not found. // Unable to access the AField field: Field 'App.AField' not found. // Unable to access the AnotherField field: Field 'App.AnotherField' not found.

System.Exception
System.SystemException
System.MemberAccessException
System.MissingMemberException
System.MissingMethodException


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


MissingMethodException コンストラクタ ()
アセンブリ: mscorlib (mscorlib.dll 内)


このコンストラクタは、新しいインスタンスの Message プロパティを初期化し、その値として "見つからないメソッドにアクセスしようとしました" などのエラーを説明するシステム提供のメッセージを指定します。このメッセージは、システムの現在のカルチャを考慮して指定します。
MissingMethodException のインスタンスの初期プロパティ値を次の表に示します。

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


MissingMethodException コンストラクタ (String, Exception)
アセンブリ: mscorlib (mscorlib.dll 内)

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

前の例外の直接の結果としてスローされる例外については、InnerException プロパティに、前の例外への参照が格納されます。InnerException プロパティは、コンストラクタに渡されたものと同じ値を返します。InnerException プロパティによって内部例外値がコンストラクタに渡されなかった場合は、null 参照 (Visual Basic の場合は Nothing) を返します。
MissingMethodException のインスタンスの初期プロパティ値を次の表に示します。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


MissingMethodException コンストラクタ (String, String)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim className As String Dim methodName As String Dim instance As New MissingMethodException(className, methodName)

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


MissingMethodException コンストラクタ (String)
アセンブリ: mscorlib (mscorlib.dll 内)


message パラメータの内容は、ユーザーが理解できる内容にする必要があります。このコンストラクタの呼び出し元は、この文字列が現在のシステムのカルチャに合わせてローカライズ済みであることを確認しておく必要があります。
MissingMethodException のインスタンスの初期プロパティ値を次の表に示します。

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


MissingMethodException コンストラクタ

名前 | 説明 |
---|---|
MissingMethodException () | MissingMethodException クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
MissingMethodException (String) | 指定したエラー メッセージを使用して、MissingMethodException クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
MissingMethodException (SerializationInfo, StreamingContext) | シリアル化したデータを使用して、MissingMethodException クラスの新しいインスタンスを初期化します。 |
MissingMethodException (String, Exception) | 指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、MissingMethodException クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
MissingMethodException (String, String) | クラス名とメソッド名を指定して、MissingMethodException クラスの新しいインスタンスを初期化します。 |

MissingMethodException コンストラクタ (SerializationInfo, StreamingContext)
アセンブリ: mscorlib (mscorlib.dll 内)

Dim info As SerializationInfo Dim context As StreamingContext Dim instance As New MissingMethodException(info, context)


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


MissingMethodException フィールド

名前 | 説明 | |
---|---|---|
![]() | ClassName | 存在しないメンバのクラス名を保持します。 ( MissingMemberException から継承されます。) |
![]() | MemberName | 存在しないメンバの名前を保持します。 ( MissingMemberException から継承されます。) |
![]() | Signature | 存在しないメンバのシグネチャを保持します。 ( MissingMemberException から継承されます。) |

MissingMethodException プロパティ

名前 | 説明 | |
---|---|---|
![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。 ( Exception から継承されます。) |
![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。 ( Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。 ( Exception から継承されます。) |
![]() | Message | オーバーライドされます。 存在しないメソッドのクラス名、メソッド名、およびシグネチャを示す文字列を取得します。このプロパティは読み取り専用です。 |
![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。 ( Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。 ( Exception から継承されます。) |
![]() | TargetSite | 現在の例外をスローするメソッドを取得します。 ( Exception から継承されます。) |


MissingMethodException メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 ( Exception から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetObjectData | 存在しないメンバのクラス名、メンバ名、シグネチャ、および追加例外情報を使用して、SerializationInfo オブジェクトを設定します。 ( MissingMemberException から継承されます。) |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 ( Exception から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 ( Exception から継承されます。) |

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

MissingMethodException メンバ
存在しないメソッドに動的にアクセスしようとした場合にスローされる例外。
MissingMethodException データ型で公開されるメンバを以下の表に示します。

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


名前 | 説明 | |
---|---|---|
![]() | ClassName | 存在しないメンバのクラス名を保持します。(MissingMemberException から継承されます。) |
![]() | MemberName | 存在しないメンバの名前を保持します。(MissingMemberException から継承されます。) |
![]() | Signature | 存在しないメンバのシグネチャを保持します。(MissingMemberException から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Data | 例外に関する追加のユーザー定義情報を提供するキー/値ペアのコレクションを取得します。(Exception から継承されます。) |
![]() | HelpLink | 例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。(Exception から継承されます。) |
![]() | InnerException | 現在の例外を発生させた Exception インスタンスを取得します。(Exception から継承されます。) |
![]() | Message | オーバーライドされます。 存在しないメソッドのクラス名、メソッド名、およびシグネチャを示す文字列を取得します。このプロパティは読み取り専用です。 |
![]() | Source | エラーの原因となったアプリケーションまたはオブジェクトの名前を取得または設定します。(Exception から継承されます。) |
![]() | StackTrace | 現在の例外がスローされたときにコール スタックにあったフレームの文字列形式を取得します。(Exception から継承されます。) |
![]() | TargetSite | 現在の例外をスローするメソッドを取得します。(Exception から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetBaseException | 派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の主要な原因である Exception を返します。 (Exception から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetObjectData | 存在しないメンバのクラス名、メンバ名、シグネチャ、および追加例外情報を使用して、SerializationInfo オブジェクトを設定します。 (MissingMemberException から継承されます。) |
![]() | GetType | 現在のインスタンスのランタイム型を取得します。 (Exception から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の例外の文字列形式を作成して返します。 (Exception から継承されます。) |

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

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

- MissingMethodExceptionのページへのリンク