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

4
  • What kind of project do you have? How are you adding the reference? Commented Feb 22, 2014 at 8:09
  • Provide more details on what you are trying to do Commented Feb 22, 2014 at 8:09
  • How did you do, and what is System_Window_Forms ?? Commented Feb 22, 2014 at 8:09
  • i am working in Visual Studio 2010 Asp.net Web Application and i am trying to add reference from Website --> Add Reference --> .NET Component. But here System.Window.Forms is not available in list Commented Feb 22, 2014 at 9:19

4 Answers 4

12

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

Sign up to request clarification or add additional context in comments.

Comments

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

2 Comments

but i am using visual studio 2010
so what? that's not a problem for your question.
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

Comments

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?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.