This documentation is archived and is not being maintained.

MethodAccessException Class

The exception that is thrown when there is an invalid attempt to access a private or protected method inside a class.

For a list of all members of this type, see MethodAccessException Members.


[Visual Basic]
Public Class MethodAccessException
   Inherits MemberAccessException
public class MethodAccessException : MemberAccessException
public __gc class MethodAccessException : public
class MethodAccessException extends MemberAccessException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


This exception is typically thrown when the access level of a method in a class library is changed, and one or more assemblies referencing the library have not been recompiled.

MethodAccessException uses the HRESULT COR_E_METHODACCESS, that has the value 0x80131510.

For a list of initial property values for an instance of MethodAccessException, see the MethodAccessException constructors.


Namespace: System

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

MethodAccessException Members | System Namespace | Exception | Handling and Throwing Exceptions