最佳答案
引用作为项目文件的一部分进行跟踪,并且通常作为 NuGet 包初始安装的一部分添加。恢复包只会下载它们。
这意味着您似乎需要重新安装那些缺少引用的特定包。
为此,run the Update-Package
command in the Package Manager Console with the -reinstall
flag on it .
Update-Package <package_name> -ProjectName MyProject -reinstall
您可以选择 add the -Version
flag如果您需要坚持使用不是最新的版本,只需使此版本号与存储在您的 packages.config 文件中的版本号相匹配即可。
或者,重新安装给定项目的所有包:
Update-Package -Reinstall -ProjectName <project_name>
关于c# - Visual Studio : how to add nuget packages as references when doing "Restore NuGet packages",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46107479/