Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you add references to dlls in visual studio?

I used nuget to succesfully install iTextSharp XMLWorker extension in my project.

However, I cannot use it without also "adding a reference" to the iTextSharp XML Worker dll.

Currently, in the solution explorer for my project file, I am right clicking on "References" and choosing to Add Reference. From the list of available assemblies, I cannot locate anything called iTextSharp or XML Worker.

Does anyone know what I'm doing wrong here?

like image 737
winbacker Avatar asked Jul 31 '14 22:07

winbacker


2 Answers

Just for the sake of new visitors who might be having the same problem, the Package Manager Console serves the purpose.
Go to Tools>NuGet Package Manager>Package Manager Console.
For iTextSharp Library, run the command.

Install-Package iTextSharp

For XML Worker, run

Install-Package iTextSharp.xmlworker

On success, Build your project and you should be able to find the references.

like image 129
Vikram Sharma Avatar answered Jan 04 '23 11:01

Vikram Sharma


You do have to search for it .

My usual method is :

1) Right-click on the project, select Add -> New folder (I name it "lib" )

2) From your file explorer, drag the file to this folder to create a copy

3) Right-click on references, Select "Browse...", go to your source folder, you'll see your "lib" folder freshly created, and you'll be able to select as many files as you want, and then check them, and it's ok They won't appear "by themselves" in the list, you must browse your filesystem for them (at least as far as I know with my limited knowledge of VS2013)

The first steps are optional but for the sake of good organisation I think it's important to keep a copy of your useful dlls with your source files. Useful for source control as well.

like image 42
Lioobayoyo Avatar answered Jan 04 '23 10:01

Lioobayoyo