Jake Smith
Jake Smith

Reputation: 2813

Can't install local NuGet package

Details

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

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!

Upvotes: 3

Views: 3831

Answers (2)

Leo Liu
Leo Liu

Reputation: 76760

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.

Upvotes: 4

Francesco B.
Francesco B.

Reputation: 3097

According to this link from the NuGet GitHub Repository, you can possibly encounter this error when the version of your package is not "normalized", i.e. it's not made up of 4 digits. Yours has 3 digits, so...

(and the last digit might have to be 0).

Upvotes: 2

Related Questions