New to Telerik Reporting? Download free 30-day trial

An Error Message Occurs When Adding a Viewer in Visual Studio

Environment

Product Progress® Telerik® Reporting
Version Q2 2012 and later
Report Viewers WinForms, WPF, ASP.NET

Description

An error message occurs when adding a viewer in Visual Studio.

Error Message

The ReportViewer control failed to setup the http handler in the web.config file. You may experience troubles when viewing the report. Exception details: Unable to cast COM object of type 'System.__ComObject' to class type 'Telerik.Reporting.Vs.Common.AssemblyReference'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.

Cause

Web sites handle assembly references differently and the Telerik Reporting Wizards and Designers are not designed to work with such settings.

Solution

Manually add viewers or upgrade the web site—you need to design reports in an external ClassLibrary project referenced by the web site project.

In this article