MethodAccessException Class
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.
Assembly: mscorlib (in mscorlib.dll)
This exception is thrown in situations such as the following:
A private, protected, or internal method that would not be accessible from normal compiled code is accessed from partially trusted code by using reflection.
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.Exception
System.SystemException
System.MemberAccessException
System.MethodAccessException
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.