|
Este artículo proviene de un motor de traducción automática. Mueva el puntero sobre las frases del artículo para ver el texto original. Más información.
|
Traducción
Original
|
MissingMethodException (Clase)
System.Exception
System.SystemException
System.MemberAccessException
System.MissingMemberException
System.MissingMethodException
Espacio de nombres: System
Ensamblado: mscorlib (en mscorlib.dll)
El tipo MissingMethodException expone los siguientes miembros.
| Nombre | Descripción | |
|---|---|---|
![]() ![]() | MissingMethodException() | |
![]() ![]() | MissingMethodException(String) | |
![]() | MissingMethodException(SerializationInfo, StreamingContext) | |
![]() ![]() | MissingMethodException(String, Exception) | |
![]() | MissingMethodException(String, String) |
| Nombre | Descripción | |
|---|---|---|
![]() | Data | |
![]() | HelpLink | |
![]() ![]() | HResult | |
![]() ![]() | InnerException | |
![]() ![]() | Message | En XNA Framework 3.0, este miembro se hereda de Exception.Message. |
![]() | Source | |
![]() ![]() | StackTrace | |
![]() | TargetSite |
| Nombre | Descripción | |
|---|---|---|
![]() ![]() | Equals(Object) | |
![]() ![]() | Finalize | |
![]() ![]() | GetBaseException | |
![]() ![]() | GetHashCode | |
![]() | GetObjectData | |
![]() ![]() | GetType | En XNA Framework 3.0, este miembro se hereda de Object.GetType(). |
![]() ![]() | MemberwiseClone | |
![]() ![]() | ToString |
| Nombre | Descripción | |
|---|---|---|
![]() | SerializeObjectState |
| Nombre | Descripción | |
|---|---|---|
![]() | ClassName | |
![]() | MemberName | |
![]() | Signature |
Nota |
|---|
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 method, // a MissingMethodException 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 example 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.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (no se admite el rol Server Core), Windows Server 2008 R2 (se admite el rol Server Core con SP1 o versiones posteriores; no se admite Itanium)
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

