FileIOPermission failed for assembly with FullTrust Permission Set

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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source: mscorlib
StackTrace: at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
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"

Share on Facebook

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.