Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Library reference vs. NuGet package [closed]

I have a C# project and I want to add a reference to it. I know how to do it but which one should I use - lib folder in the project or package installation via NuGet? It would be great to have the pros and cons for both with some explanation when the one is better than the other. My current opinion is that I should use NuGet whenever possible because I can see if there is an update for the library directly in VS. But I need more information on the topic...

like image 883
Antiohia Avatar asked May 13 '16 06:05

Antiohia


People also ask

Is a NuGet package a library?

NuGet is a package manager for the . NET ecosystem and is the primary way developers discover and acquire . NET open-source libraries.

How do I unblock NuGet packages?

Solution 1Right click on your downloaded copy of nuget.exe and select "Properties". Now tick the Unblock then press apply. Now try again the pack operation.

How do I resolve a NuGet conflict?

You add this reference as you would any other NuGet package: in VisualStudio right-click on project -> "Manage NuGet Packages..." search for Microsoft. CodeAnalysis. CSharp and install it. Save this answer.

Where are NuGet packages references stored?

NuGet keeps a configuration file that defines some basic options about how and from where to retrieve these packages: On Windows, the NuGet. config file is kept in %AppData%\NuGet.


1 Answers

If the reference is made by you, but managed by, say, a different team, then I'd create a share on the network, or make my own NuGet Server so that you can update your own application, and be independent of how the other team operates.

You can set up a "NuGet Server" very easilly, just create an empty MVC application, and then add "Nuget server" directly from nuget hehe.

A file share on your local network can also serve as a nuget source.

I'm trying to come up with a good, valid reason for NOT wanting to use nuget or any other package managemer source, but I simply cannot. Those old-school "hard links" to references just do not resonate with me, maybe someone else can provide guidance on that.

like image 100
Pedro G. Dias Avatar answered Oct 05 '22 12:10

Pedro G. Dias