다음을 통해 공유


MissingMethodException.Message 속성

손실된 메서드의 클래스 이름, 메서드 이름 및 서명을 나타내는 텍스트 문자열을 가져옵니다. 이 속성은 읽기 전용입니다.

네임스페이스: System
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Overrides ReadOnly Property Message As String
‘사용 방법
Dim instance As MissingMethodException
Dim value As String

value = instance.Message
public override string Message { get; }
public:
virtual property String^ Message {
    String^ get () override;
}
/** @property */
public String get_Message ()
public override function get Message () : String

속성 값

오류 메시지 문자열입니다.

설명

개체를 생성할 때 클래스 이름을 지정하지 않은 경우 기본 클래스에서 상속된 기본 텍스트 문자열이 반환됩니다.

이 속성은 Message를 재정의합니다. 오류 메시지는 지역화해야 합니다.

예제

다음 예제에서는 Message 속성을 보여 줍니다. 이 코드 예제는 MissingMethodException 클래스에 대해 제공되는 보다 큰 예제의 일부입니다.

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 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);
}

플랫폼

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에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

MissingMethodException 클래스
MissingMethodException 멤버
System 네임스페이스