Warning: All projects that reference MyProject.csproj must install the Microsoft.Bcl.Build nuget package

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

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

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

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. This eliminates one of two warnings. But VS does not give me the ability to manage NuGet packages for the MyProject.Azure project .

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

EDIT:

Thanks to the user swell, I now know that the Microsoft Connect problem for this problem was open.

+82
visual-studio visual-studio-2012 nuget
Jun 18 '13 at 22:45
source share
4 answers

If you double-click a warning, it gives instructions on how to turn off the warning.

It is safe to disconnect project links from projects that do not yet support Nuget.

See the section below in bold , copied from Microsoft.Bcl.Build.targets.

BclBuildValidateNugetPackageReferences

This link can be disabled for the project link by setting SkipValidatePackageReferences = true for the link:

 <ProjectReference Include="..\pcl\pcl.csproj"> <Project>{664a9e98-fac7-4567-a046-0dde95fddb48}</Project> <Name>pcl</Name> <Properties>SkipValidatePackageReferences=true</Properties> </ProjectReference> 
+52
Jun 21 '13 at 18:54
source share

The answer provided by TheESJ is correct, but the wording was not clear to me. Since I cannot comment on the answer, I will provide more details here. In particular, I ran into this problem with the Azure project, and the following workaround was required to warn about this:

When you double-click a warning in VisualStudio, you will be taken to the BclBuildValidateNugetPackageReferences target in the Microsoft.BclBuild.targets file. Above the actual target element, you should find a large block of comments that says disabling project link checking. Because Azure projects cannot have bibliographic references, it is not possible for those Azure projects to meet the requirements of this specific build goal.

Decision? Disable link checking from the Azure project because you cannot add a link to the nuget package.

Example

So, suppose we have two projects: MyAzureProject.ccproj , which references MyProject.csproj . Follow these steps:

  • Right-click on “MyAzureProject” in Solution Explorer and select “Edit Project File”.
  • Find the link to the MyProject project. It should look something like this:

     <ProjectReference Include="..\MyProject\MyProject.csproj"> <Name>MyProject</Name> <Project>{1d99490e-d140-4897-9890-238e673a5864}</Project> ... </ProjectReference> 
  • Add the following element inside the ProjectReference element:

      <Properties>SkipValidatePackageReferences=true</Properties> 
  • Now your project link will look like this:

     <ProjectReference Include="..\MyProject\MyProject.csproj"> <Name>MyProject</Name> <Project>{1d99490e-d140-4897-9890-238e673a5864}</Project> ... <Properties>SkipValidatePackageReferences=true</Properties> </ProjectReference> 
  • Right-click on "MyAzureProject" in Solution Explorer and select "Update Project."

You should now be able to rebuild, and the error should disappear.

+59
Sep 19 '13 at 19:34
source share

I ran into the same problem and tried to update Microsoft.Bcl.Build.targets; that didn't help.

After some research, it turned out that the .csproj file of the Azure Service project must be modified to include <Properties>SkipValidatePackageReferences=true</Properties> .

This was not visible from @THEESJ's answer and therefore decided to post a separate answer. Thanks @THEESJ.

+15
Aug 14 '13 at 16:22
source share

I have encountered this problem several times and the Properties method really works, but when dealing with a Wix project, I had to do the following:

 <AdditionalProperties>SkipValidatePackageReferences=true</AdditionalProperties> 

When I used the Properties Xml node, I got a new error:

The OutputPath property is not set for the project "MyInstallerProject.csproj". Please make sure that you provide the correct combination of configuration and platform for this project. Configuration = 'Debug' Platform = 'x86'. This error may also occur if any other project tries to follow the project link to the project for this project, this project has been unloaded or not included in the solution, and the link project is not created using the same or equivalent Configuration or Platform.

0
Feb 07 '19 at 13:48
source share



All Articles