警告:所有引用MyProject.csproj的项目都必须安装nuget包Microsoft.Bcl.Build [英] warning : All projects referencing MyProject.csproj must install nuget package Microsoft.Bcl.Build

查看:473
本文介绍了警告:所有引用MyProject.csproj的项目都必须安装nuget包Microsoft.Bcl.Build的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在VS 2012中开发的ASP.NET MVC 4应用程序.该应用程序包含一个主项目(MyProject),一个单元测试项目(MyProject.Tests),一个Azure部署项目(MyProject.Azure)和几个通用库项目.

I have an ASP.NET MVC 4 app developed in VS 2012. The app consists of a main project (MyProject), a unit-test project (MyProject.Tests), an Azure deployment project (MyProject.Azure), and a couple of general-purpose library projects.

当我右键单击解决方案或主项目并选择管理NuGet程序包"时,我会看到许多Microsoft更新,这些更新显然在上个月左右可用.如果单击全部更新"按钮,则显然已安装更新,而没有任何明显的问题,但是在构建解决方案时,我收到此错误消息TWICE:

When I right-click on either the solution or the main project and select Manage NuGet Packages, I see a bunch of Microsoft updates that have apparently become available in the last month or so. If I click on the Update All button then the updates are apparently installed without any obvious problems, but when I build the solution I get this error message TWICE:

warning : All projects referencing MyProject.csproj must install nuget package Microsoft.Bcl.Build

好,所以我有两个引用MyProject的项目:MyProject.Tests和MyProject.Azure.我可以右键单击MyProject.Tests,选择ManageNuGet Packages,然后添加Microsoft.Bcl.Build.这摆脱了两个警告之一.但是 VS没有给我提供管理MyProject.Azure项目的NuGet包的选项.

Ok, so I have two projects that reference MyProject: MyProject.Tests and MyProject.Azure. I can right-click MyProject.Tests, select ManageNuGet Packages, and add Microsoft.Bcl.Build. That gets rid of one of the two warnings. But VS does not give me an option to manage NuGet packages for the MyProject.Azure project.

如何将Microsoft.Bcl.Build包添加到Azure部署项目中?

How do I add the Microsoft.Bcl.Build package to the Azure deployment project?

感谢用户膨胀,我现在知道此问题的Microsoft Connect问题已经打开

Thanks to user swell, I now know that a Microsoft Connect issue for this problem has been opened here.

推荐答案

如果双击警告,它将为您提供有关禁用警告的说明.

If you double click the warning it gives you instructions for disabling the warning.

从尚不支持Nuget的项目中禁用项目引用是安全的.

It is safe to disable for projectreferences from projects that don't yet support Nuget.

请参阅从Microsoft.Bcl.Build.targets复制的粗体的以下部分.

See below portion in bold copied from Microsoft.Bcl.Build.targets.

BclBuildValidateNugetPackageReferences

BclBuildValidateNugetPackageReferences

可以通过为参考设置 SkipValidatePackageReferences = true 来禁用此目标作为项目参考:

This target can be disabled for a project reference by setting SkipValidatePackageReferences=true for the reference:

<ProjectReference Include="..\pcl\pcl.csproj">
  <Project>{664a9e98-fac7-4567-a046-0dde95fddb48}</Project>
  <Name>pcl</Name>
  <Properties>SkipValidatePackageReferences=true</Properties>
</ProjectReference>

这篇关于警告:所有引用MyProject.csproj的项目都必须安装nuget包Microsoft.Bcl.Build的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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