title: The application attempted to perform an operation not allowed by the security policy
body: <p>I have developed an Asp.net website in Visual Studio 2008 and it worked fine while using Vista OS but my workstation got upgraded to Windows 7 and I now get following error:</p>
  
  <blockquote>
    <p>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. </p>
    
    <p>Exception Details: System.Security.SecurityException: Request for the
    permission of  type 'System.Web.AspNetHostingPermission, System,
    Version=2.0.0.0, Culture=neutral,  PublicKeyToken=b77a5c561934e089'
    failed.</p>
  </blockquote>
  
  <p>I get this error while running on my local machine from within Visual studio... I have already googled the error but nothing i found helps so far. I don't get the error when deployed on server, just on my local. </p>
  
  <p>The website references .dll projects that I have created in the same solution. The error seems to occur when I try to instaniate an object contained within any one of these .dll projects. </p>
  
  <p>This setting in Web.config did not help:</p>
  
  <pre><code>&lt;trust level="Full" originUrl="" /&gt;
  </code></pre>
  
  <p>neither did this:</p>
  
  <pre><code>&lt;securityPolicy&gt;
      &lt;trustLevel  name="Full" policyFile="internal" /&gt;
  &lt;/securityPolicy&gt;
  </code></pre>