Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReportViewer 11 (2012) Visual Studio 2010

I am using Visual Studio 2010 and I installed "Microsoft Report Viewer 2012 Runtime" hoping to test the new reporting system in SQL 2012. After which I cleared for ref to "Microsoft.ReportViewer.WebForms" from my Web.config and removed the ReportViewer control from my toolbox and added the new version 11 ReportViewer.

I added the new control to a testing page and for one it adds this register to the test page:

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

and it adds these entry to the Web.config:

<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>

<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
</httpHandlers>

<handlers>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>

The control in the toolbox is the version 11 addition but the system keeps trying to ref the verion 10 edition. Also when I try to compile it I get the error:

The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\11.0.0.0__89845dcd8080cc91\Microsoft.ReportViewer.WebForms.DLL'
like image 339
Nicholas Avatar asked Aug 30 '12 14:08

Nicholas


1 Answers

I think I had the exact same problem. If so, my solution was to delete all entries in web.config referencing ReportViewer, then do the same in References, build the project and then re-ADD a reportviewer in the page.

web.config will update with new handlers and assemblies for the newer version.

like image 168
tgondar Avatar answered Sep 20 '22 18:09

tgondar