当我尝试运行.NET程序集时(boo.exe
)从网络共享(映射到驱动器),它失败,因为它只是部分信任:
Unhandled Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at BooCommandLine..ctor()
at Program..ctor()
at ProgramModule.Main(String[] argv)
The action that failed was:
LinkDemand
The assembly or AppDomain that failed was:
boo, Version=0.0.0.0, Culture=neutral, PublicKeyToken=32c39770e9a21a67
The Zone of the assembly that failed was:
Intranet
The Url of the assembly that failed was:
file:///H:/boo-svn/bin/boo.exe
随着指示 一篇博文,我向.NET配置添加了一个完全信任所有程序集的策略 file:///H:/*
作为他们的URL。我通过输入URL验证了这一点 file:///H:/boo-svn/bin/boo.exe
进入 评估大会 .NET配置中的工具,并注意到boo.exe具有 无限制 许可(政策之前没有)。
即使获得许可, boo.exe
不运行。我仍然得到相同的错误消息。
我该怎么做来调试这个问题?是否有另一种方法可以从网络共享运行“部分受信任”的程序集,而无需为我想要运行的每个程序集更改某些内容?