title: Security Error with Report Viewer Control and RDLC Reports in ASP.NET 4.0
body: <p>Using ASP.NET 4.0, I'm creating an RDLC stream by instantiating a <code>Microsoft.ReportingServices.RdlObjectModel.Report</code>, setting the <code>Code</code> property, and returning the stream using the <code>RdlSerializer</code>.</p>
  
  <p>Then I'm passing that stream to the ReportViewer like so:</p>
  
  <pre><code>ReportViewer1.LocalReport.LoadReportDefinition(rdlcStream);
  </code></pre>
  
  <p>If I don't set the <code>Code</code> property, I don't get any errors and the report displays properly, but when I set the <code>Code</code> property for a report that needs custom code, I get the below mentioned <code>'RequestMinimum' is obsolete</code> error.</p>
  
  <blockquote>
    <p>An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC40000] 'RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See <a href="http://go.microsoft.com/fwlink/?LinkID=155570">http://go.microsoft.com/fwlink/?LinkID=155570</a> for more information.'.’.</p>
  </blockquote>
  
  <p>This error doesn't occur using the Report Viewer control in a winforms app.</p>
  
  <p>Has anyone seen/resolved this issue? </p>