Sunday, January 15, 2012

Microsoft.Reporting.WebForms.ReportViewer is not compatible

While integrating ReportViewer with SP2010 I faced an old issue

The base class includes the field 'ReportViewer1', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer).

As I hate to get into same problem again. Here's a list of things I tried to make it work.

To understand the issue its a version mismatch issue. Check what's the latest version of ReportViewer ( Microsoft.Reporting.WebForms.dll) you have. On SP2010, its

If you are using any lower version i.e. or then you need to update it all places to avoid this.

1. Check to make sure you don't have @Register directive pointing to old version. This you can do by searching '' or '' in complete project.

2. Clean the VS2010 solution and rebuild

3. Remove binary reference from Visual Studio project and add it again. Try Building it again

4. Check web.config to find you don't have entries pointing to old versions.

5. Sometime closing Project and opening it again helps

6. IISReset to ensure there are no caching issues with old versions