title: Get legacy CAS Model value programmatically in ASP.NET
body: <p>I use VS 2012 and ASP.NET 4.5.</p>
  
  <p>How can I know if <strong><em>legacy CAS model</em></strong> is enabled <code>programmatically</code> in C# (executing my code in ASP.NET 2.0 - CLR 2.0 , and ASP.NET 4.5 (CLR 4.0) ? and which <strong>level</strong> ?</p>
  
  <pre><code>&lt;system.web&gt;
  
      &lt;trust legacyCasModel="true" level="Full"/&gt;
  
    &lt;/system.web&gt;
  
   &lt;runtime&gt;
  
      &lt;NetFx40_LegacySecurityPolicy enabled="true"/&gt;
  
    &lt;/runtime&gt;
  </code></pre>