views:

1246

answers:

5

I have just moved a site from a Windows 2003, IIS6 SQL 2005 server to a new one with Windows 2008, IIS7 and SQL 2008.

I am having problems with the Report Viewer. I have installed the Report Viewer Re-distributable (I've tried 2005, 2005sp, 2008 and 2008sp) I've Mapped a handler in IIS for

Reserved.ReportViewerWebControl.axd

to type

Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

However whenever I run a report on the website I get the following error message:

Could not load type 'Microsoft.Reporting.Microsoft.Reporting.WebForms.HttpHandler' from assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Could not load type 'Microsoft.Reporting.Microsoft.Reporting.WebForms.HttpHandler' from assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

I am stumped. Any ideas?

+1  A: 

I think you need to map to version 9.0.0.0 and not 8.0.0.0

Locksfree
Thanks. I changed all the 9.0.0.0 to 8.0.0.0 throughout and that sorted it. Does this mean I am running on an earlier version?
SystemicPlural
+1  A: 

you need to sure this setting should be in your live server web.config

<compilation debug="true">
<assemblies>
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</buildProviders>

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

Looks like this issue has been resolved for a while now, but for anyone searching:

Note the assembly being referenced in the error: Microsoft.Reporting.Microsoft.Reporting.WebForms.HttpHandler

It should just be Microsoft.Reporting.WebForms.HttpHandler - how we both ended up with that in our web.config is suspicious, but may have something to do with manually creating the handler in IIS and letting IIS write the handler key to the app's web.config (now of course I can't reproduce it).

For anyone moving to IIS7, bear in mind that the handler mapping now lives in and not as it was in earlier versions. IIS7 will ignore the old httpHandlers section but you may be checking the settings there out of habit and getting frustrated that your settings aren't taking effect.

Stefan Mohr
A: 

If you are running under IIS 7 it is worth checking the handler also has permission to execute.

After setting mine up I could see the handler was just throwing a 500 exception, on closer inspection it seems just adding the handler to the list is not enough. You must also edit its permission becuase by default it is not allowed to execute. Ticking the box to let it execute, and solved my problem immediately.

Binny
A: 

Here is the complete solution for all your questions. http://praveenbattula.blogspot.com/2010/03/fix-to-report-viewer-problems-in-iis-7.html

Rare Solutions