SecurityPermission

Execution permission is required for a SecurityPermission setting on all .NET applications and for any managed code that you want a user to run.

Table A-11 shows the required SecurityPermission settings for functions and objects in Windows Forms targets.

Table A-11: SecurityPermission required in Windows Forms targets

Function, object, property, or feature

Permission required

OLEControl

Unrestricted (or the Full Trust option)

ChangeDirectory, Handle, Post, Restart, Run, Send,

UnmanagedCode

URL (PictureHyperlink and StaticHyperlink property),

UnmanagedCode

HyperlinkToURL (Inet property)

UnmanagedCode

Language interoperation feature

Variable permissions required, depending on .NET function called or property accessed

Win32 API feature

UnmanagedCode

Table A-12 shows the required SecurityPermission settings for interactions with .NET or Win32 functions and properties in Web Forms targets.

Table A-12: SecurityPermission required in Web Forms targets

Feature

Permission required

Language interoperation

Variable permissions required, depending on .NET function called or property accessed

Win32 API

UnmanagedCode

Example 1

The following XML sets required security permissions for Windows Forms targets:

<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="Assertion, Execution, BindingRedirects, UnmanagedCode" />

Example 2

The following XML sets required security permissions for Web Forms targets:

<IPermission class="SecurityPermission" version="1" Flags="Assertion, Execution, ControlThread, ControlPrincipal, RemotingConfiguration, UnmanagedCode"/>