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

查看:12
本文介绍了警告:所有引用 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 包时,我看到了一堆微软更新,这些更新显然在上个月左右可用.如果我单击全部更新"按钮,则显然已安装更新,没有任何明显问题,但是当我构建解决方案时,我会收到此错误消息 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?

感谢用户 swell">swell,我现在知道针对此问题的 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="..pclpcl.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天全站免登陆