从Visual Studio 2017中找不到丢失的NuGet包 [英] Stuck at missing NuGet package from Visual Studio 2017

查看:204
本文介绍了从Visual Studio 2017中找不到丢失的NuGet包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


大家好!



尝试在VS 2017中构建一段示例代码,我收到错误消息:  



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



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



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



我看到的文件:Microsoft.Bcl.B uild.targets。



包管理器设置中的两个包恢复选项都被勾选/启用。



提前感谢任何指针/建议。

解决方案

Hi alecela,


欢迎来到MSDN论坛。


请参阅错误信息,请查看

这个类似的问题
。备份整个解决方案,然后右键单击VS中的项目名称并选择"卸载项目",检查这个nuget包'Microsoft.Bcl.Build'路径是否正确并且存在于您的计算机上或者从.csproj
文件中删除以下代码:


 
<
目标
名称 = " EnsureNuGetPackageBuildImports "
BeforeTargets = " PrepareForBuild " >


   
<
PropertyGroup >


     
<
ErrorText > 这个项目引用了这台计算机上缺少的
NuGet包。使用NuGet Package Restore下载它们。 
了解更多有关信息,请参阅http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件为{0}。
< / ErrorText >


   
< /
PropertyGroup >


   
<
错误
条件 = " !Exists('.. \ packagesages \ Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props') "
文字 = "


([System.String] :: Format('


(ErrorText)',
'..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props')) " />


   
<
错误
条件 = " 存在时(" .. \packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\\\
et45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')
"
文字 = "


Hi all!

Trying to build a piece of sample code within VS 2017 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.

Both package restore options within package manager settings are ticked/enabled.

Thanks in advance for any pointer/suggestion.

解决方案

Hi alecela,

Welcome to the MSDN forum.

Refer to the error message, please have a look at this similar issue. Backup the whole solution, then right click the project name in the VS and choose ‘Unload Project’, check this nuget package ‘Microsoft.Bcl.Build’ path is correct and existing on your computer or remove the following code from the .csproj file:

  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

    <PropertyGroup>

      <ErrorText>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 {0}.</ErrorText>

    </PropertyGroup>

    <Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props')" Text="


([System.String]::Format('


(ErrorText)', '..\packages\Microsoft.Net.Compilers.2.4.0\build\Microsoft.Net.Compilers.props'))" />

    <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="


这篇关于从Visual Studio 2017中找不到丢失的NuGet包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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