4

I have a nuget package file (*.nupkg) saved on my Desktop. I am trying to get this into my Visual Studio solution. Does anyone know how to do this?

  • Is it not available from a regular package manager? You'd usually just add a package reference. If you *only* have it as a file, you can create a new directory as a package manager source, and put the file in there. – Jon Skeet Sep 10 '20 at 11:18
  • @JonSkeet Would I still be able to reference it by doing that? And do you have a reference or steps on how to do this? – James McKinney Sep 10 '20 at 11:22
  • 1
    Yes, but you need to configure the local package source. See https://learn.microsoft.com/en-us/nuget/hosting-packages/local-feeds and https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio#package-sources – Jon Skeet Sep 10 '20 at 11:25
  • You can take a look at this answer: https://stackoverflow.com/a/10240180/779182 – Frank_FC Sep 10 '20 at 11:26
  • @Frank_FC that does not seem to work. – James McKinney Sep 10 '20 at 11:40

1 Answers1

1

Please follow the below steps.

  1. Open solution exploler of your project from Visual Studio.

  2. Right click on the project in which you want add the nuget package.

  3. Select Manage NuGet Packages.

  4. Click on the settings icon present on the right top of the window.

  5. Click on ' + ' and give a name add the nuget package location where it is saved in your local computer.

  6. Click ok and switch "Package source" to your recently added one. which enables to search for the package from the newly added location.

  7. Search and reference the package in your project.

Mahesh Anakali
  • 344
  • 1
  • 8