Assembly: mscorlib (in mscorlib.dll)
is similar to Deny, in that both cause stack walks to fail when they would otherwise succeed. The difference is that Deny specifies permissions that will cause the stack walk to fail, but specifies the only permissions that do not cause the stack walk to fail. Call this method to ensure that your code can be used to access only the specified resources.
is ignored for a permission not granted because a demand for that permission cannot succeed. However, if code lower on the call stack later calls Demand for that permission, a SecurityException is thrown when the stack walk reaches the code that tried to call . This is because the code that called has not been granted the permission, even though it called for that permission. The call stack is typically represented as growing down, so that methods higher in the call stack call methods lower in the call stack.
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
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.