TeamCity - Microsoft.Bcl.Build dependency

I just made some code changes in my repository and all of a sudden (after a few weeks when I was fine). The TC build starts with a failure because it cannot download the NuGet package for Microsoft.Bcl.Build.1.0.6.

I had to manually copy the contents of the package directory to the TC build location, which completely defeats the NuGet point.

What can I check to get the root cause of this?

Everything related to NuGet is included in the solution for receiving packages.

+3
nuget msbuild teamcity
06 Sep '13 at 9:35 on
source share
4 answers

OK This is a bit of a nasty problem.

If you are having this problem, you need to do something pretty ugly to your repository.

Make sure you check the packages\repositories.config file.

Then, if your assembly does not work with unresolved references to Microsoft.Bcl.Build, you will also need to check the .targets file for this package. eg:

 package\Microsoft.Bcl.Build.xxx\tools\Microsoft.Bcl.Build.targets 

Stealth ...

+2
06 Sep '13 at 10:34 on
source share

I wrote about this issue at http://sedodream.com/2012/12/24/SlowCheetahBuildServerSupportUpdated.aspx . NuGet package recovery aggregation (prior to version 2.7) is implemented as part of the MSBuild build process. When MSBuild starts the build, it will evaluate the project file, and any imported ads will import other files. This happens before any goal is completed.

Since NuGet pkg recovery is part of the build process, .targets files are restored at a specific point in time when it is too late for the Import statement to have any effect.

You can work around this either by checking the .targets file as you stated, or by calling pkg recovery before the build process. I created a NuGet package, PackageRestore , which can help with the latter approach.

To use PackageRestore, simply add the NuGet package to the project, which will automatically create a file called packageRestore.proj in your projects directory. When setting up your build, you will need to create this element in front of your .sln / .csproj file.

+4
Sep 12 '13 at 19:24
source share

This blog post is the most comprehensive I've seen to explain workarounds:

http://blogs.msdn.com/b/dotnet/archive/2013/06/12/nuget-package-restore-issues.aspx

No big IMO - this problem still needs a better solution.

But for now, the most recommended option is to check the Bcl.Build.targets file for the original control, which means that when the version of Bcl.Build is updated, you need to add a new .targets file and delete the old one.

+1
May 23 '14 at 4:57
source share

I think (but not sure, so I created this SO question: What does the Microsoft.Bcl.Build NuGet package do ) that Microsoft.Bcl. The assembly is needed only for development and is not needed on the assembly server. So, I have a Builder.targets file that exists only in the build environment, indirectly <import> ed in all our projects, including this bit of MSBuild xml:

 <!-- Skip Microsoft.Bcl.Build functionality when building only from Source. Presumably Microsoft.BclBuild is only needed for development. --> <PropertyGroup> <BclBuildImported>Ignore</BclBuildImported> </PropertyGroup> 

Since the MSBuild logic block inserted into your project by the Bcl.Build nuget package depends on the BclBuildImported property BclBuildImported empty, this effectively wraps the problem in my build environment - Microsoft.Bcl.Build steps are skipped and it no longer destroys my CI assemblies.

Please note that since it seems that this package controls binding redirects in your app.config and ensures that transitive dependencies are included in your projects, it is important to leave it to the development. But at the moment I do not know about the need for this in the build server environment.

0
Apr 02 '14 at 23:43 on
source share



All Articles