title: Exception Details: System.Security.SecurityException: Request failed
body: <p>I have deployed a website on server (Windows Hosting).</p>
  
  <p>I am getting the following error:</p>
  
  <pre><code>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 failed.
  
  Source Error:
  
  An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
  
  </code></pre>
  
  <p>I have searched and found that the solution is to add the following code to webconfig file</p>
  
  <pre><code>&lt;trust level="Full"/&gt;
  </code></pre>
  
  <p>But this produces the error</p>
  
  <pre><code>Configuration Error
  Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
  
  Parser Error Message: This configuration section cannot be used at this path.  This happens when the site administrator has locked access to this section using &lt;location allowOverride="false"&gt; from an inherited configuration file.
  
  Source Error:
  
  
  An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
  
  Line: 24
  </code></pre>
  
  <p>On <strong>Line:24</strong> in webconfig file is </p>
  
  <pre><code>&lt;trust level="Full"/&gt;
  </code></pre>
  
  <p>How to resolve this ?</p>
  
  <p>I am using
  Target  Framework: .NET Framework 4.7.2</p>
  
  <p><strong>Edit</strong></p>
  
  <p>You can check for that <em>Code Access Security</em> is already set to <em>Full</em>.</p>
  
  <p><a href="https://i.stack.imgur.com/RA4ur.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RA4ur.png" alt="enter image description here"></a></p>