What does the Microsoft.Bcl.Build NuGet package do?

I can not find the documentation on this subject - links from the Microsoft.Bcl.Build Nuget page do not give much support

This package provides components of the build infrastructure to successfully create projects that reference specific Microsoft packages.

Do not link directly to these packages if you have not received a build warning that prompts you to add a link.

From looking at the Microsoft.Bcl.Build.targets file, it looks like it controls link redirects and package links. It seems that some of these functions are only used when working in Visual Studio.

Can someone provide more information on what this package does? This is a pain in our server-side build environment ; can it be ignored when building completely from the source code (for example, creating a server environment)?

+67
Apr 02 '14 at 23:06
source share
2 answers

If you look at Microsoft.Bcl.Build.targets , it has many project configuration goals, for example:

  • EnsureBindingRedirects - identify which EnsureBindingRedirects links to redirect bindings, and update app.config with them
  • BclBuildValidateNugetPackageReferences - this goal verifies that all Nuget packages installed in the current project also have their dependencies (transitive dependencies) installed in the current project.

Based on this assessment, I decided that this functionality is necessary only in the development environment when adding / removing / updating NuGet dependencies; and that it can be ignored in a CI environment where it causes problems.

Therefore, I want to keep the dependency in my * .csproj files, but ignore it when starting the CI build. I did this by adding conditional imports to the build environment's targets file (e.g. builder.targets), which includes this block:

 <!-- Skip Microsoft.Bcl.Build functionality when building only from Source. --> <PropertyGroup> <BclBuildImported>Ignore</BclBuildImported> </PropertyGroup> 

This causes targets to be ignored in the CI environment, but activated in the development environment. It works for me for more than a week, and no problems so far ...

I would still like to know if anyone has the best information about this package, which indicates that doing this is a bad idea. So far, I think this is a good idea.

Edit 2018-02-01:

Note that the ignore parameter can also be passed on the command line to skip the logic of Microsoft.Bcl.Build.targets :

 msbuild (targets, etc) /p:BclBuildImported=Ignore 
+21
Apr 11 '14 at 23:43
source share

This is basically a way for older packages designed for older .Net to create and compile without problems on new .Nets

If you go to http://blogs.msdn.com/b/bclteam/p/bclbuild.aspx, you will see two ads linking to http://blogs.msdn.com/b/dotnet/archive/2013/11 /13/pcl-and-net-nuget-library-are-now-enabled-for-xamarin.aspx and http://blogs.msdn.com/b/dotnet/archive/2013/08/12/improved-package - restore.aspx, which should explain this.

+9
Apr 02 '14 at 23:28
source share



All Articles