SecurityException thrown on deployment

前端 未结 2 362
一生所求
一生所求 2021-01-22 19:57

I have just written an MVC application and got it working in my lab. Now that I\'ve deployed it to GoDaddy, I am getting the following error.

Description:

相关标签:
2条回答
  • 2021-01-22 20:35

    This appears to be an issue with a mismatch between the version of .NET I'm using to build my app and the one provided on the host.

    Thank you Microsoft for another error message that seems to tell me nothing about what the underlying issue is.

    0 讨论(0)
  • 2021-01-22 20:40

    It seems like the problem is the "Trust level". You need to specify which trustlevel you require in your web.config for your site. The problem though is that GoDaddy might not allow the trust level that your site requires. One of the trust levels allows/disallows e.g. reflection(e.g. IoC containers use reflection or AutoMapper).

    The trust level thing is something Microsoft has stated that they do not support anymore, so any bugfixes etc that makes it unsecure is no longer fixed. So one solution might be to find another webhost is the change to the web.config doesn't fix your problem.

    Example config:

    <system.web>
      <securityPolicy>
        <trustLevel name="Full" policyFile="internal"/>
      </securityPolicy>
    </system.web>
    
    0 讨论(0)
提交回复
热议问题