Home > database >  How to link a library package of C# in Visual Studio 2022 so that I can use it every time in any sol
How to link a library package of C# in Visual Studio 2022 so that I can use it every time in any sol

Time:01-02

I have some libraries like Colorful.Console from GitHub, I used to use it frequently. Every time I started a new project, I have to install this library de novo. How can I install it so that it became available every time?

CodePudding user response:

Use the NuGet package for it

  1. Go to Tools >> NuGet Package Manager >> Manage Packages for Solution
  2. Click on the "Browse Tab"
  3. Type in "Colorful" and the package will appear
  4. Add it to the projects you need.

You'll find NuGet packages for many of the things on GitHub. That's the best way to re-use them.

CodePudding user response:

Option 1 Create a new console project, add the desired NuGet package(s). Next export the project as a enter image description here

Which is better? it dependents on what suits you, I always use exported project templates and sometimes use the toolbox method along with Resharper which allows creating of snippets that can be used in project files similar to option 2 but not stored in the toolbox.

  • Related