in my c# project which i develop in visual studio i have multiple nuget dependencies and whenever a friend of mine pushes to the repository i get the following error:
Severity Code Description Project File Line Suppression State Error NU1100 Unable to resolve 'Esprima (>= 3.0.4)' for 'net8.0'. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org. MModule C:\Users\usr\Desktop\prj\Modules\folder\MModule\MModule.csproj 1
i can always resolve such errors by updating or reinstalling at least one nuget package in the project. i feel like it has to do something with the following sentence contained in the error message:
the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org
which leads me to my question: why does it not consider nuget.org? imo this correlates to me "resetting" the pkg list or something by updating or reinstalling. is there any way for me to force the consideration of nuget.org? thanks in advance
I used the workaround from Björn Larsson quite a lot, however I found a solution to my problem. Following a hint from Visual Studio, that my package source mapping was off (I don't rembember the exact formulation) I simply removed any Package Source Mapping.
In Visual Studio under Options/NuGet PackageManager/Package Source Mapping I removed all source mappings.
Have had no build problems ever since!
Please check the package source mapping of the nuget config. If there is some source mappings, remove them. Or you can make sure there's a matching pattern for the package in question.
Take a look of the official document:
Scenario 2 of NuGet Error NU1100
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With