Search code examples
c#visual-studionuget

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


Solution

  • 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!