New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nuget Incorrectly Reporting "Unable to find a stable package" #13399
Comments
Thanks for reporting this. I tried reproducing the issue with the same version of .NET SDK 8.0.204 and when adding either Microsoft.AspNetCore.Mvc.NewtonsoftJson version 8.0.4 or SendGrid 9.29.3 to a project, the issue did not reproduce for me. I want to better understand if there's something particular about the project that is the issue or if this is reproducing with a new project for you as well. Could you try creating a new Console App and for that project, running: And let us know if that succeeds? |
edgett@imac ~ % cd /Volumes/Data/Websites/Staging
edgett@imac Staging % mkdir test
edgett@imac Staging % cd test
edgett@imac test % dotnet new console --framework net8.0 --use-program-main
The template "Console App" was created successfully.
Processing post-creation actions...
Restoring /Volumes/Data/Websites/Staging/test/test.csproj:
Determining projects to restore...
Restored /Volumes/Data/Websites/Staging/test/test.csproj (in 114 ms).
Restore succeeded.
edgett@imac test % dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson --version 8.0.4
Determining projects to restore...
Writing /var/folders/ht/bnz7h_6d1jb01dg6y7kjltxm0000gn/T/tmpB0czL0.tmp
info : X.509 certificate chain validation will use the fallback certificate bundle at '/usr/local/share/dotnet/sdk/8.0.204/trustedroots/codesignctl.pem'.
info : X.509 certificate chain validation will use the fallback certificate bundle at '/usr/local/share/dotnet/sdk/8.0.204/trustedroots/timestampctl.pem'.
info : Adding PackageReference for package 'Microsoft.AspNetCore.Mvc.NewtonsoftJson' into project '/Volumes/Data/Websites/Staging/test/test.csproj'.
info : Restoring packages for /Volumes/Data/Websites/Staging/test/test.csproj...
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.newtonsoftjson/index.json
info : OK https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.newtonsoftjson/index.json 82ms
error: NU1103: Unable to find a stable package Microsoft.AspNetCore.Mvc.NewtonsoftJson with version (>= 8.0.4)
error: - Found 154 version(s) in nuget.org [ Nearest version: 9.0.0-preview.1.24081.5 ]
error: Package 'Microsoft.AspNetCore.Mvc.NewtonsoftJson' is incompatible with 'all' frameworks in project '/Volumes/Data/Websites/Staging/test/test.csproj'. |
Additional Update I ran the following sudo nuget update --self This indicated that I was running a 5.x version of Nuget (I forgot to note which exact version and accidentally exited the terminal), and 6.9.1.3 was available. I then executed:
Now the restore succeeded and the packages installed correctly. So, the following questions remain:
|
.NET ships a version of the NuGet CLI but you would access it using There must be something between the 5.x and 6.9.x versions of NuGet that prevented the Are there any additional details you can provide about your setup that could help us get a repro? |
Older Intel-based iMac with 32GB RAM, running macOS Catalina 10.15.7 (waiting for the next update to the Mac Studio to get off this ancient but serviceable machine). I have VS Code 1.88.1 and the aforementioned versions of .NET. I may have had Visual Studio for Mac at some point, perhaps that is where the version of Nuget came from, because I wouldn’t have went out of my way to install a standalone client. |
NuGet Product Used
Visual Studio Package Manager Console
Product Version
dotnet restore
Worked before?
Yes, whatever build was available in early March.
Impact
I'm unable to use this version
Repro Steps & Context
dotnet --list-runtimes
to verify install of runtime:dotnet --list-sdks
to verify install of SDKs:For a project with the following in the CSPROJ,
dotnet restore
works fine:Changing references to...
and running
dotnet restore
causes these errors to be raised (path removed):Determining projects to restore...
error NU1103: Unable to find a stable package Microsoft.AspNetCore.Mvc.NewtonsoftJson with version (>= 8.0.4)
error NU1103: - Found 154 version(s) in nuget.org [ Nearest version: 9.0.0-preview.1.24081.5 ]
error NU1102: Unable to find package SendGrid with version (>= 9.29.3)
error NU1102: - Found 117 version(s) in nuget.org [ Nearest version: 9.29.2 ]
Failed to restore (in 1.34 sec).
Running
dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson --version 8.0.4
Determining projects to restore...
Writing /var/folders/ht/bnz7h_6d1jb01dg6y7kjltxm0000gn/T/tmpWugafd.tmp
info : X.509 certificate chain validation will use the fallback certificate bundle at '/usr/local/share/dotnet/sdk/8.0.204/trustedroots/codesignctl.pem'.
info : X.509 certificate chain validation will use the fallback certificate bundle at '/usr/local/share/dotnet/sdk/8.0.204/trustedroots/timestampctl.pem'.
info : Adding PackageReference for package 'Microsoft.AspNetCore.Mvc.NewtonsoftJson' into project '/Volumes/Data/Websites/Staging/vintagejeeps.net/live/Framework.csproj'.
info : Restoring packages for ...
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.newtonsoftjson/index.json
info : GET https://api.nuget.org/v3-flatcontainer/sendgrid/index.json
info : OK https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.newtonsoftjson/index.json 262ms
info : OK https://api.nuget.org/v3-flatcontainer/sendgrid/index.json 306ms
error: NU1103: Unable to find a stable package Microsoft.AspNetCore.Mvc.NewtonsoftJson with version (>= 8.0.4)
error: - Found 154 version(s) in nuget.org [ Nearest version: 9.0.0-preview.1.24081.5 ]
error: NU1102: Unable to find package SendGrid with version (>= 9.29.3)
error: - Found 117 version(s) in nuget.org [ Nearest version: 9.29.2 ]
info : GET https://api.nuget.org/v3/vulnerabilities/index.json
info : OK https://api.nuget.org/v3/vulnerabilities/index.json 23ms
info : GET https://api.nuget.org/v3-vulnerabilities/2024.03.23.05.37.04/vulnerability.base.json
info : GET https://api.nuget.org/v3-vulnerabilities/2024.03.23.05.37.04/2024.03.24.11.37.12/vulnerability.update.json
info : OK https://api.nuget.org/v3-vulnerabilities/2024.03.23.05.37.04/vulnerability.base.json 22ms
info : OK https://api.nuget.org/v3-vulnerabilities/2024.03.23.05.37.04/2024.03.24.11.37.12/vulnerability.update.json 22ms
error: Package 'Microsoft.AspNetCore.Mvc.NewtonsoftJson' is incompatible with 'all' frameworks in project
Tried running
nuget locals all -clear
to no effect...Verbose Logs
No response
The text was updated successfully, but these errors were encountered: