3

i used visual studio 2010 and i need to add System.Windows.Forms in my project but when i am trying to add this then it shows error i.e.

enter image description here

please give me solution for this

chitrakant sahu
  • 211
  • 3
  • 8
  • 18

4 Answers4

11

Problem: You are trying to add the System_Windows_Forms from COM tab of Reference Manager window.

Problem here:

enter image description here Solution : You need to Add System.Windows.Forms from Assemblies -> Framework Tab of Reference Manager window.

Select as below: enter image description here

Sudhakar Tillapudi
  • 25,935
  • 5
  • 37
  • 67
2

A console application does not automatically add a reference to System.Windows.Forms.dll.

Right-click your project in Solution Explorer and select Add reference... and then find System.Windows.Forms and add it.

and

Did you try to add it from the COM-tab? Find the System.Windows.Forms.dll in the .NET-tab instead!

enter image description here

Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234
1

In VS 2010. Add Reference -> ".NET" tab -> System.Windows.Forms

If you cant see it there, then check to what .NET framework version your project is set (Add reference should show you to what version it filters libraries or check project properties.) and make sure you have that version installed.

How to find installed versions: http://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx

Edit: Also, if you are using Vista or later, you should migrate your project to .NET 4 if it already isn't.

.NET 4 installer: http://www.microsoft.com/en-us/download/details.aspx?id=17851

.NET 3.5 installer: http://www.microsoft.com/en-us/download/details.aspx?id=21

If you are using Windows 8 or 8.1 here is how you can enable older framework versions: http://msdn.microsoft.com/en-us/library/hh506443(v=vs.110).aspx

Labris
  • 82
  • 3
0

Please don't do this. You mention you have a web application and you are adding windows form DLL to it. This is not correct way of doing whatever it is that you are doing. What exactly are you trying to accomplish?

danish
  • 5,550
  • 2
  • 25
  • 28