NuGet 错误 NU1101

方案 1

Unable to find package 'PackageId'. No packages exist with this id in source(s): sourceA, sourceB, sourceC

问题

无法在任何源上找到包。

解决方案

在 Visual Studio 中检查项目的依赖项,以确保使用了正确的包标识符和版本号。 此外,确保 NuGet 配置已标识出应使用的包源。 如果使用具有语义版本控制 2.0.0 的包,请务必在 NuGet 配置中使用 V3 源 https://api.nuget.org/v3/index.json

方案 2

Unable to find package 'PackageId'. No packages exist with this id in source(s): sourceA PackageSourceMapping is enabled, the following source(s) were not considered: sourceB, sourceC.

问题

在 PackageSourceMapping 已配置的任何源上均未找到此包。

解决方案

在 Visual Studio 中检查项目的依赖项,以确保使用了正确的包标识符和版本号。 检查 NuGet.Config 是否存在 PackageSourceMapping 配置。 有问题的包可能是在未配置的源上提供。