Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget package "Not available in this source"... but VS still knows about it?

I've come across a screen that I've never seen before, while playing with Npgsql.EntityFrameworkCore.PostgreSQL source code, looking for a bug that's blocking my app from running properly.

As things stand right now, I can't even build the source code.

screenshot

I can't build this code, because the packages can't be found; yet, Visual Studio knows that the latest release is the one I want. How is this possible? What (if anything) can I do to get the packages installed?

like image 608
Jeremy Holovacs Avatar asked Apr 08 '18 14:04

Jeremy Holovacs


People also ask

How do I fix a missing NuGet package?

Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

How do I add NuGet package source to Visual Studio?

Set up Visual Studio In Visual Studio, select Tools, and then select Options. Select NuGet Package Manager, and then select Package Sources. Enter the feed's Name and Source URL, and then select the green (+) sign to add a new package source. If you enabled upstream sources in your feed, clear the nuget.org checkbox.

How do I force a NuGet package to reinstall?

Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.

Are all NuGet packages open source?

NuGet Package Licenses Types Open source, and more specifically those publishing to Nuget.org, tend to use the SPDX License List, a standard list of licenses available to reference.


2 Answers

Thanks @LeoLiu-MSFT In my case, I was not seeing any other option than the Microsoft Visual Studio Offline package so I need to add myself.

  1. click on the setting Icon

enter image description here

  1. Below window will open write the NuGet details if does not allow to write edit the existing
  nuget.org
  https://api.nuget.org/v3/index.json

enter image description here

like image 142
Ishika Jain Avatar answered Oct 16 '22 11:10

Ishika Jain


Nuget package “Not available in this source”… but VS still knows about it?

You should select nuget.org as package source, not All. Tseng pointed the correct direction. You probably have a myget feed in your project/Visual Studio.

According to the package Microsoft.EntityFrameworkCore on the nuget.org, the latest version is only 2.1.0-preview1-final (current version) not have the version 2.1.0-preview3-32169. So the package you have installed is not comes from nuget.org.

If you add a custom nuget feed with source: https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json

Then you will see the version 2.1.0-preview3-32169.

So, to resolve this issue, you should select the nuget.org as package source or disable the package source from dotnet.myget.org.

Hope this helps.

like image 12
Leo Liu-MSFT Avatar answered Oct 16 '22 11:10

Leo Liu-MSFT