YOU can use the Code Access Security Tool (Caspol.exe) to turn security on and off.
To turn off security, type the following command at the command prompt:
caspol -security off
To turn on security, type the following command at the command prompt:
caspol -security on
In the .NET Framework 4.0, for using Caspol.exe, you first need to set the <LegacyCasPolicy> element to true.