MVC 5 'System.Security.Permissions.ReflectionPermission'

Discussion in 'General troubleshooting' started by Philip, Oct 19, 2014.

  1. Hi!

    I'm getting the following error from my website. Its a new MVC 5 app that I just threw together and I haven't added any nuget packages besides the default ones that already come with a new project. The site is hosted at the domain : ww.theclevergoose.com

    I've included <trust level="Medium"/> in my webconfig

    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.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
     
  2. Elshadriel

    Elshadriel Winhost Staff

    Try setting the trust level to "Full".
     
  3. I have the same issue. My website is 9res.org. I set trust level to full.

    <system.web>
    <securityPolicy>
    <trustLevel name="Full" policyFile="internal" />
    </securityPolicy>

    and am still getting the error msg:

    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: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
     
  4. ComputerMan

    ComputerMan Winhost Staff

    Remove the extra stuff at the end and only use the following:

    <configuration>
    <system.web>
    <trust level="Full"/>
    </system.web>
    </configuration>

    Make sure you add the full trust right after the system.web section in the web.config.
     

Share This Page