困惑于VS 2017上的nuget包恢复 [英] confused on nuget package restore on VS 2017

查看:251
本文介绍了困惑于VS 2017上的nuget包恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从Github构建一段示例代码,我收到错误消息:  


错误 此项目引用此计算机上缺少的NuGet包。使用NuGet Package Restore下载它们。 有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkID=322105。缺少的
文件是.. \ packages.\\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets。


但是当我查看以下文件夹时:


.. \ packagesages \ Microsoft.Bcl.Build.1.0.21\build


我看到的文件是:Microsoft.Bcl.Build.targets。


提前致谢指针/建议。

解决方案

您好,


欢迎来到MSDN论坛。


您可以在软件包管理器控制台中使用NuGet命令行(工具> Nuget软件包管理器>软件包管理器控制台):


Update-Package -reinstall


强制将包引用重新安装到项目中。


此外,您还可以查看该主题并尝试其中的解决方案:


https://stackoverflow.com/questions/32254439/nuget-packages-are-missing


删除此项来自.csproj文件的代码:
$
< Target Name =" EnsureNuGetPackageBuildImports" BeforeTargets =" PrepareForBuild">

  ...... <
< / Target>


祝你好运,


Joyce


Trying to build a piece of sample code from Github and I got the error message of:  

Error This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets.

BUT when I look into the folder of:

..\packages\Microsoft.Bcl.Build.1.0.21\build

I do see the file: Microsoft.Bcl.Build.targets.

Thanks in advance for any pointer/suggestion.

解决方案

Hi,

Welcome to MSDN forum.

You can use the NuGet command line in the Package Manager Console(Tools > Nuget Package Manager > Package Manager Console):

Update-Package -reinstall

to force reinstall the package references into project.

Besides, you can also have a look at the thread and try solutions in it:

https://stackoverflow.com/questions/32254439/nuget-packages-are-missing

Removing this code from .csproj file:
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
  ......
</Target>

Best regards,

Joyce


这篇关于困惑于VS 2017上的nuget包恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆