Why does Microsoft.ReportViewer.WebForms 8.0.0.0 not appear in the Visual Studio 2010 "Add References" dialog?

Brant Bobby picture Brant Bobby · Mar 16, 2011 · Viewed 9.4k times · Source

I'm creating a web application project targeting .NET 3.5 that needs to use the Reporting Services 2005 report viewer control (8.0.0.0) to view some old reports. I installed the redistributable package and version 8.0 of the assembly Microsoft.ReportViewer.WebForms is in the GAC (along with 9.0 and 10.0), but the "Add References" dialog in VS2010 is only displaying 9.0 and 10.0.

Why is the assembly not being shown, and how can I reference it?

Answer

Hans Passant picture Hans Passant · Mar 16, 2011

It is a "redistributable", it is only meant to install the required runtime assemblies into the GAC on the target machine. Getting a reference assembly that you can use on your dev machine would require an installer to leave a copy of the assembly in a 'well known location' and/or to write a registry key so that the reference assembly shows up in the Add Reference dialog.

I suspect you get such a reference assembly only from installing VS2005. Not sure, I don't have it installed anymore. A reference assembly is just a copy of the one in the GAC. So one possible workaround is to copy the assembly you need from the GAC to your project directory, allowing you to use the Browse tab of the dialog to add it to your project. The shell extension that hides the internal structure of the GAC from Explorer makes that a bit of a hassle. Use a non-Explorer based file manager or the command prompt. It is stored in a subdirectory of c:\windows\assembly