Search code examples
c#.netvisual-studio-2010referenceassembly-references

The type or namespace name 'WinForms' does not exist


I was trying to biuld my project, when I got the following error:

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

I have already added this references:

using System.Windows.Forms;

using Microsoft.Reporting.WinForms;

using Microsoft.Reporting.WebForms;


And I'm using Visual Studio 2010, with .Net framework 4.0.

How can I fix this error?

Thanks


Solution

  • Even if you added the using its most probable that you don't have a reference to the Microsoft.Reporting dll. You need to add a reference to the Microsoft.Reporting dll in the project that is generating this error. I usually use the solution explorer in VS and right-click on the project -> Add Reference.

    Do note that in the Add Reference dialog you generally have multiple sources available

    P.S. I say the Microsoft.Reporting dll but because I assume that Microsoft.Reporting.WinForms is a namespace in said dll, but there could be a separate Microsoft.Reporting.Winforms dll