If we want to "fully trust" the assemblies, it can be done through the signed assemblies. In Visual Studio 2005, you need to select the Properties for the project and select the Signing tab. After you installed (including the newly signed assemblies) you need to give permission to the assemblies. This can be done using a tool called CASPOL.EXE.
The CASPOL or Code Access Security Policy tool enables users and administrators to modify security policy for the machine policy level, the user policy level, and the enterprise policy level. For detailed information, you can have a look at the following article.
Find the command line for registering your file: caspol -u -ag All_Code -url "<full path to your file>" FullTrust -n "<assembly name>"
If you have more than one file or if you want to do this for a directory: caspol -u -ag All_Code -url "<directory path>\*" FullTrust