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...
NuGet is a package manager for the . NET ecosystem and is the primary way developers discover and acquire . NET open-source libraries.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With