Updated: July 2009
The exception that is thrown when there is an invalid attempt to access a method, such as accessing a private method from partially trusted code.
Namespace:
System
Assembly:
mscorlib (in mscorlib.dll)
Visual Basic (Declaration)
<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public Class MethodAccessException _
Inherits MemberAccessException
Dim instance As MethodAccessException
[SerializableAttribute]
[ComVisibleAttribute(true)]
public class MethodAccessException : MemberAccessException
[SerializableAttribute]
[ComVisibleAttribute(true)]
public ref class MethodAccessException : public MemberAccessException
public class MethodAccessException extends MemberAccessException
This exception is thrown in situations such as the following:
A private, protected, or internal method is accessed from partially trusted code.
A security-critical method is accessed from partially trusted code.
The access level of a method in a class library has changed, and one or more assemblies that reference the library have not been recompiled.
MethodAccessException uses the HRESULT COR_E_METHODACCESS, which has the value 0x80131510.
For a list of initial property values for an instance of MethodAccessException, see the MethodAccessException constructors.
System..::.Object
System..::.Exception
System..::.SystemException
System..::.MemberAccessException
System..::.MethodAccessException
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
.NET Compact Framework
Supported in: 3.5, 2.0
XNA Framework
Supported in: 3.0, 2.0, 1.0
Reference
Other Resources
Date | History | Reason |
|---|
July 2009
| Clarified the summary and provided additional information about when this exception is thrown. |
Content bug fix.
|