Unable to find package NETStandard.Library

11k views Asked by At

I tried to add a new Class library(.Net Standard) in Visual studio 2019. But I get this error message:

Unable to find package NETStandard.Library. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages.

I haven't added any code to this file yet. When I go to NugetManager I can see this message:

NetStandard.Library not available at this source

Can anyone please help me with this issue?

3

There are 3 answers

2
Afshin On BEST ANSWER

Your package source in visual studio is on the Microsoft Visual Studio Offline Packages. You should Go to Package Manager Settings (Tools > Nuget Package Manager > Package Manager Settings).
On the package sources section enter
Name : nuget.org
source :https://api.nuget.org/v3/index.json
add this package source to your visual studio and click ok.

0
tmaj On

I've experienced this with a 3.1 exe referencing a .net standard 2.1 assemly.

NU1102: Unable to find package NETStandard.Library with version (>= 1.6.0)
  - Found 10 version(s) in nuget.org [ Nearest version: 1.6.0 ]
  - Found 0 version(s) in Local Cloud Packages (For VSTS builds)

I addressed this by making the referenced assembly's <TargetFramework> in csproj match the exe project's <TargetFramework>.

0
William Herrmann On

I also had this particular issue. My problem was not resolved by the other answers here.

There was a packages-lock.json file in my project. All I had to do was delete it.