Bug 29809 - When building, I get a warning relating to installing the nuget package Microsoft.Bcl.Build but it's already installed
Summary: When building, I get a warning relating to installing the nuget package Micro...
Status: CONFIRMED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: NuGet ()
Version: 5.9
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Matt Ward
URL:
Depends on:
Blocks:
 
Reported: 2015-05-06 14:42 UTC by Matt Samet
Modified: 2016-07-05 03:15 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 29809 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Matt Samet 2015-05-06 14:42:43 UTC
Apparently, this warning is famous.  Tons of people have it, several people say "you just need to ignore it", but it would be great if the underlying problem could be fixed.

I have a solution set up with my PCL project and an iOS project.  Using MvvmCross.  When building the iOS project, it gives the following warning:

All projects referencing MyProject-PCL.csproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.

This warning seems harmless, my app runs fine but I'm wondering what is going on to cause it.  I have the latest version of all packages, including Microsoft.Bcl.Build, installed into both my PCL and my iOS project.

My PCL is 4.5 - Profile78.

My iOS project has a reference to my PCL project.

Here is a list of nuget packages installed into BOTH my PCL and iOS projects (all are latest versions):

Cheesebaron.MvxPlugins.ModernHttpClient
EShyMedia.MvvmCross.Plugins.Settings
Fody
Microsoft.Bcl
Microsoft.Bcl.Build
Microsoft.Net.Http
modernhttpclient
MvvmCross
MvvmCross.HotTuna.CrossCore
MvvmCross.HotTuna.MvvmCrossLibraries
MvvmCross.HotTuna.Plugin.DownloadCache
MvvmCross.HotTuna.Plugin.File
MvvmCross.HotTuna.Plugin.Json
MvvmCross.HotTuna.Plugin.Messenger
MvvmCross.HotTuna.Plugin.Network
MvvmCross.HotTuna.Plugin.Sqlite
MvvmCross.HotTuna.StarterPack
MvvmCross.PortableSupport
Newtonsoft.Json
NullGuard.Fody
PropertyChanged.Fody

Xamarin Studio 5.9.431 stable, Mac OS X 10.10.3.

I'd like to add that this warning has been present for a very long time, at least a year.

When trying to reproduce this issue, please create a new project that's as close to the configuration I've mentioned here as you can.  If you can't reproduce it, I will see if I can create a minimal project that exhibits the issue and upload it for you.
Comment 1 Hines Vaughan III 2015-05-26 12:17:20 UTC
I receive the same error when building my Xamarin Forms Android and iOS projects, using the latest version of everything along with modernhttpclient. Just noticed the issue today.
Comment 2 Matt Ward 2015-06-01 13:19:18 UTC
It seems to either be an xbuild problem or a problem with the Microsoft.Bcl.Build.Tasks.dll.

You can reproduce the problem on the Mac, but not on Windows, using two C# library projects. One referencing the other. You also need to use a type from the referenced project in the other project to force the assembly to be referenced. Then if you add the Microsoft.Bcl.Build NuGet package to both projects you get a warning about the Microsoft.Bcl.Build needing to be referenced by all projects when it already is.

On Windows it works and does not give a warning when compiling in Xamarin Studio.

I put together a simple solution that reproduces the problem on GitHub.

https://github.com/mrward/test-ms-bcl-build-nuget-package

The source code on GitHub also adds some extra logging to the Microsoft.Bcl.Build.targets file.

The problem seems to be that on Windows the correct paths to the referencing project are passed to the BclBuildValidateNugetPackageReferences target:


    Target BclBuildValidateNugetPackageReferences:

        BclBuildReferencingProject = d:\projects\MSBclBuildTest\MSBclBuildTest\MSBclBuildTest.csproj

        BclBuildReferencingProjectConfig = d:\projects\MSBclBuildTest\MSBclBuildTest\packages.config

        ReferencedProject = d:\projects\MSBclBuildTest\CommonLibrary\CommonLibrary.csproj

        ReferencedProjectPackagesConfig = d:\projects\MSBclBuildTest\CommonLibrary\packages.config

Whilst on the Mac the BclBuildReferencingProject and BclBuildReferencingProjectConfig properties are empty:


    Target BclBuildValidateNugetPackageReferences:

        BclBuildReferencingProject = 

        BclBuildReferencingProjectConfig = 

        ReferencedProject = /projects/MSBclBuildTest/CommonLibrary/CommonLibrary.csproj

        ReferencedProjectPackagesConfig = /projects/MSBclBuildTest/CommonLibrary/packages.config


The only workaround for the Mac is to add the SkipValidatePackageReferences property and set it to true in the common project that is being referenced.

<SkipValidatePackageReferences>true</SkipValidatePackageReferences>


If you are building the solution from the command line using xbuild you will need to pass the extra property /p:BuildingInsideVisualStudio=true otherwise the warning about Microsoft.Bcl.Build not being referenced will not be displayed.

This problem may be fixed once the official MSBuild source code has added to Mono.