Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install local NuGet package

Details

  • Using Visual Studio 2017
  • Built NuGet package with NuGet Package Explorer
  • Placed .nupkg file in local folder on disk
  • Added folder to Package Sources in Visual Studio
  • I attempt to install the package using the Visual Studio GUI (Tools > NuGet Package Manager > Manage NuGet Packages for Solution...).

Problem

My package shows up in the list in the GUI, but when I click install, an error message says it can't find the package in the folder I put the .nupkg file in:

Package 'TDDeviceIntegration 1.0.0' is not found in the following primary source(s): 'C:\Users\j.smith\Documents\Visual Studio 2017\LocalNugetRepository\'. Please verify all your online package sources are available (OR) package id, version are specified correctly.   

What I've tried

  • Putting the NuGet Package I've built in several different local folder locations and adding those to the Package Sources, all with the same result (it can't find the package I JUST put there).
  • I've restarted Visual Studio several times.
  • I've restarted my computer.
  • I've cleared my NuGet cache(s) from Visual Studio

Question

How do I diagnose this? How do I fix this? I just want to make sure that the NuGet package works locally before I give it to the rest of the team.

Thanks in advance!

like image 319
Jake Smith Avatar asked Nov 15 '25 12:11

Jake Smith


1 Answers

How do I diagnose this? How do I fix this? I just want to make sure that the NuGet package works locally before I give it to the rest of the team.

Just as @orhtej2 comment, you should:

you rename it to TDDeviceIntegration.1.0.0.nupkg? (dot instead of space between package name and version).

Additional, some info about why dot is really the only allowed package name-version separator.

That because namespace of nuget package follows a pattern similar to namespaces in .NET, using dot notation instead of hyphens.

You can get the source from following document:

Choosing a unique package identifier and setting the version number

enter image description here

Hope this helps.

like image 180
Leo Liu-MSFT Avatar answered Nov 18 '25 21:11

Leo Liu-MSFT