Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NU1100 the following sources were not considered

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

like image 426
macman Avatar asked Jan 31 '26 18:01

macman


2 Answers

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!

like image 187
macman Avatar answered Feb 03 '26 09:02

macman


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

like image 42
Bowman Zhu Avatar answered Feb 03 '26 09:02

Bowman Zhu