4
votes

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?

6
Can you see the controls installed correctly in the GAC?Cᴏʀʏ

6 Answers

1
votes

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

1
votes

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>
1
votes

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.

1
votes

Also might be worthwhile trying this if any of the other suggestions here don't work -

http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/0152bb52-988d-43f5-9c3d-8d33512f46de/

"There were a number of problems with the Transition to IIS 7. Considerable debugging was required.

FIRST ISSUE RESOLVED: Directory permissions for the IIS 7 application pool identity (the default was Network Service) needed to be added so that the IIS application pool could have access to the physical path of the Website directory.

SECOND ISSUSE RESOLVED: A line needed to be added to the ASP.Net application web.config file. Child of After

Added:

THIRD ISSUE RESOLVED The Default App pool upon install has .Net Framework 2.0 as default. This was fine. The Default App pool setting for Managed Pipeline Mode needed to be changed from 'Integrated' (default) to 'Classic', this was the quick fix to keep my app running as it had on IIS 6."

Changing managed pipeline mode to "classic" fixed it for me.

0
votes

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 <system.webServer> <handlers> and not <system.web> <httpHandlers> 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.

0
votes

Just include CommanClassLibrary.dll in your project's Bin Folder and make sure on aspx page and config file your ReportViewer Web Control version should be same