我对 facebook C# sdk (ASP.net) 还很陌生,我正在使用 Facebook C# SDK v5 示例“CSASPNETFacebookApp”,在开发机器中一切正常,但是当我将其上传到我的 Godaddy 共享主机时,我得到了一个安全异常:
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: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
请告诉我如何解决这个问题?还是更换托管服务器更好?
最佳答案
我遇到了这个问题,并通过将“信任级别”设置“完全”添加到 web.config 文件的 system.web 部分来修复它:
<system.web>
<trust level="Full" />
看看这个 MSDN article了解设置此选项的详细信息和影响。
希望这有帮助。
关于security - Facebook-C#-sdk:v5 安全异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5284267/