Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a reference to assembly in C#? [duplicate]

Tags:

c#

.net

c#-4.0

I am getting the error:

the type 'system.windows.controls.control' is defined in an assembly that is not referenced".

How to add a reference to assembly?

like image 856
voraD Avatar asked Feb 04 '14 04:02

voraD


2 Answers

For completeness, and in the unlikely event that you are not using Visual Studio (which you didn't specify), you can add assembly references to csc using the /r: compiler option. Likewise with the <References> element of the <Csc> task in msbuild.

like image 59
harpo Avatar answered Nov 04 '22 05:11

harpo


Solution Explorer > References (Rigth-click) > Add Reference

Search for System.Windows and add it to your references.

Also see the documentation: How to: Add or Remove References By Using the Add Reference Dialog Box

like image 20
Selman Genç Avatar answered Nov 04 '22 06:11

Selman Genç