System.Security.SecurityException: Request failed. issue on web server [resolved]

While hosting your website on shared hosting server you might get the System.Security.SecurityException: Request failed issue which will give you below stack trace on landing page of the website.

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.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

  • You can add below code to your Application web.config file to resolve it permanently

    <customErrors mode="Off"/>
    <trust level="Full" />
  • This issue might occur in the case when server does not have higher version of .Net framework installed. suppose your application is developed to work with 4.5 run-time framework but the same version is not installed on the server. You can ask your web hosting provider to install the required version on the server so that your website will work as expected.

You can refer below Microsoft support post for detailed information on this issue.


Popular posts from this blog

Implement Logging in CSV file using Nlog in .net core MVC application- part 2

Implement Nlog in .Net core MVC application part 1

Angular User Session Timeout example step by step

Disable backspace key using Jquery

Devexpress Datebox date formatting in angular 6 with example