That assembly does not allow partially trusted callers.
主機信任級別受限security policy,That assembly does not allow partially trusted callers.
http://www.cmszs.com/2010/07/security-policy-that-assembly-does-not-allow-partially-trusted-callers/
?
新寫了一個asp.net的測試程序,用到第三方dll文件,放到了godaddy的windows主機上,出現以下異常
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: That assembly does not allow partially trusted callers.
這是因為很多主機服務商把信任級別設為了Medium,而應用三方dll卻需要full信任級別。如果不能讓服務商更改信任級別,可以嘗試通過以下方法解決。
如果你的dll有源碼,打開源代碼
更改AssemblyInfo.cs 文件,加入下列代碼
using System.Security;
using System.Security.Permissions;
[assembly: AllowPartiallyTrustedCallers]
從新生產dll文件。
?
轉載于:https://www.cnblogs.com/yelaiju/archive/2012/06/20/2556620.html
總結
以上是生活随笔為你收集整理的That assembly does not allow partially trusted callers.的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Symfony常用指令(收藏版)
- 下一篇: ibatis和myibatis