After setting fulltrust for an .net assembly to enable it to run from a network share I ran into a figured got into an exception saying:
Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
StackTrace: at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.IO.DirectoryInfo..ctor(String path)
After trying a while I figured out, that this occures if the code group points to a single assembly. As soon as I pointed it to the whole directory it worked.
This might be because other assemblies are used by the main application.
The call I used to set the code group is
caspol.exe -machine -addgroup LocalIntranet_Zone -url "z:\pathtofile\*" FullTrust -name "mynewcodegroup"