39
votes

I simply get the following error:

The type or namespace name 'Reporting' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

after adding this to my code:

protected global::Microsoft.Reporting.WebForms.ReportViewer ReportViewer1;

I've seen some solutions saying I must add some assemblies. but none of them worked. here is an example:

<add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

can anyone help me with this?

6

6 Answers

30
votes

In my case I needed to actually install Microsoft Report Viewer on the troublesome machine.

Of course, other ones are available, it can be worked out which from the Version= on the dll which one is needed. In my case I needed version 11 (the 2012 one).

28
votes

I did it by right-clicking on References folder in my project and then selecting Add Reference. and then adding Assemblies > Extensions > Microsoft.ReportViewer to the references.

14
votes

All these installs didn't work for me at all. What worked for me inside Visual Studio 2015 is installing the following two packages (I only needed these two) from NuGet (menu Project > Manage NuGet Packages):

  • Microsoft.ReportViewer.Common.VS2010
  • Microsoft.ReportViewer.WinForms.VS2010

The references were added to current project automatically.

5
votes

Install ReportViewer from Nuget Package Manager

2
votes

Just install SSDT. Then you need to remove the broken reference and re-add it from Assemblies > Extensions.

0
votes

import from : C:\Program Files (x86)\Microsoft Visual Studio 11.0\ReportViewer\Microsoft.ReportViewer.WebForms.dll