在服务器上抛出安全异常,在本地主机上运行

Throws Security Exception on server , runs on localhost

虽然 运行 我在本地主机上的项目运行良好。但是当我将它部署到我的服务器上时,我遇到了这种类型的错误。 错误 : 说明: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.

it's getting cause of server security level limitation, you need to fixed this in your Web.Config file.

you can asked to Serve Vendor to change the Security Level for your Host.

<system.web>
  <securityPolicy>
    <trustLevel name="Full/High/Medium/Low/Minimal" policyFile="internal"/>
  </securityPolicy>
</system.web>

查看参考资料Here