title: Why does the VS 2010 ASP .NET ReportViewer fail to render parameters when a custom RoleProvider is specified?
body: <p>I have taken a sample SSRS report from <a href="http://gotreportviewer.com/" rel="nofollow noreferrer">http://gotreportviewer.com/</a>. The report displays some customer data and the "City" parameter. The report also uses the "City" parameter to filter the data. This report runs just fine unless I enable a custom RoleProvider through web.config. I have set break points in all of the methods of my custom RoleProvider subclass, and I have created a UserDecorator to wrap the default User context so that I can set a breakpoint there as well.</p>
  
  <p>When the custom RoleProvider is enabled, the report fails to render correctly, but the ReportError event is not raised. Further, none of the methods on the RoleProvider or custom IPrincipal are called. The following is the debug output from the output window:</p>
  
  <p>A first chance exception of type 'System.Security.SecurityException' occurred in mscorlib.dll</p>
  
  <p>A first chance exception of type 'System.Security.SecurityException' occurred in Microsoft.ReportViewer.ProcessingObjectModel.dll</p>
  
  <p>A first chance exception of type 'System.Security.SecurityException' occurred in Microsoft.ReportViewer.Common.dll</p>
  
  <p>A first chance exception of type 'Microsoft.ReportingServices.ReportProcessing.ReportProcessingException' occurred in Microsoft.ReportViewer.Common.dll</p>
  
  <p>A first chance exception of type 'Microsoft.ReportingServices.ReportProcessing.ReportProcessingException' occurred in Microsoft.ReportViewer.Common.dll</p>
  
  <p>A first chance exception of type 'Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException' occurred in Microsoft.ReportViewer.Common.dll</p>
  
  <p>My understanding was that Code Access Security was deprecated in .NET 4.0, so I'm a little confused as to what the ReportProcessingException could be. I don't think it's a trust issue because the report executes just fine when not using a custom RoleProvider. I don't understand why the RoleProvider affects anything since none of its methods are ever being called.</p>
  
  <p><strong>It is a requirement of the project that I use an in-house RoleProvider.</strong></p>
  
  <p>Here is a link to the demo project: <a href="http://cid-7c1d9f1e46206d43.office.live.com/self.aspx/Public/Blog%20Solutions/ReportViewerDemo.zip" rel="nofollow noreferrer">http://cid-7c1d9f1e46206d43.office.live.com/self.aspx/Public/Blog%20Solutions/ReportViewerDemo.zip</a></p>
  
  <p>Enable or Disable the RoleProvider via the web.config</p>
  
  <p>
     
      
     
    </p>
  
  <p>Can anyone explain why this is happening? And what the workaround is?
  Thanks!</p>