當我嘗試從網絡共享(映射到一個驅動器).NET程序集(boo.exe
),它失敗,因爲它只是部分信任:運行「部分受信任的」 .NET從網絡共享組件
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
根據a blog post的說明,我向.NET配置添加了一個策略,完全信任所有使用file:///H:/*
作爲其URL的程序集。我通過將URL file:///H:/boo-svn/bin/boo.exe
輸入到.NET配置中的評估組裝工具並注意到boo.exe具有無限制權限(它在策略之前沒有)來驗證此問題。
即使有權限,boo.exe
也不會運行。我仍然收到相同的錯誤信息。
我能做些什麼來調試這個問題?是否有另一種方法可以從網絡共享中運行「部分可信」程序集,而無需爲每個要運行的程序集更改某些內容?
這在Windows 7中顯然不起作用 – 2010-12-09 17:07:46