Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a .dll reference to a project in Visual Studio

I am just beginning to use the MailSystem.NET library. However, I cannot figure out where to add the .dll files so I can reference the namespaces in my classes. Can someone please help me? I am using Visual Studio 2010. Thank you for any information, there is so little online.

like image 345
eatonphil Avatar asked Oct 20 '12 20:10

eatonphil


People also ask

How do I add a reference to a project in Visual Studio?

You can also right-click the project node and select Add > Project Reference. If you see a References node in Solution Explorer, you can use the right-click context menu to choose Add Reference. Or, right-click the project node and select Add > Reference.


2 Answers

Copy the downloaded DLL file in a custom folder on your dev drive, then add the reference to your project using the Browse button in the Add Reference dialog.
Be sure that the new reference has the Copy Local = True.
The Add Reference dialog could be opened right-clicking on the References item in your project in Solution Explorer

UPDATE AFTER SOME YEARS
At the present time the best way to resolve all those problems is through the
Manage NuGet packages menu command of Visual Studio 2017/2019.
You can right click on the References node of your project and select that command. From the Browse tab search for the library you want to use in the NuGet repository, click on the item if found and then Install it. (Of course you need to have a package for that DLL and this is not guaranteed to exist)

Read about NuGet here

like image 166
Steve Avatar answered Sep 19 '22 20:09

Steve


For Visual Studio 2019 you may not find Project -> Add Reference option. Use Project -> Add Project Reference. Then in dialog window navigate to Browse tab and use Browse to find and attach your dll.

Add Project Reference

Click Browse button to access File Explorer

like image 24
Sergiy Velychko Avatar answered Sep 17 '22 20:09

Sergiy Velychko