0
votes

Edit: After submitting this post I identified the real issue: MSBuild/TFSBuild does not deploy .dll 'CopyLocal=true' files if they are found in the GAC. In this case the "System.net.http.formatting" dll is in the GAC on the build server. Look here and here

After an upgrade from TFS 2012 to 2015, the build agent no longer copies the following DLLs to the drop locations. How can I identify why the build agent is not copying those files?

system.net.http.formatting, System.Web.Http.dll or System.Web.Http.WebHost.dll

Detail

  • We have solution with MVC projects that reference the above dlls.
  • The .csproj files use a hint path to reference the files in the solution /packages/... directory. I have confirmed the path is a valid: the solution has a packages directory.
  • Before the upgrade to TFS 2015, when building the solution, the above files are copied to the drop location. However they are not after the upgrade.
  • The build does not fail, however after the TFS 2015 update the target web server throws a 'file not found' error. (MVC is not and cannot be installed on the target web server)

  • The build utilizes a 2012 XAML Build Definition

  • Looking at the build log files, both reference the .dll files

    CSC.exe ... /reference:D:\B\15...\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll

  • The build logs shows that only the version build by TFS 2012 copies the .dll file to the drop location. The 2015 build log does not have a line similar to the following:

    Copying file from "D:..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll" to "D:..\BIN\EG.WS.EZScan.Web.Intranet\System.Net.Http.Formatting.dll

  • The build server was not changed during the upgrade other than the re-install of the build agent. The server was not rebuilt. No components were removed or added.
  • The project did not update to a newer version of MVC. The projects reference version 4.0.0.0. The GACed files on the build server is version 4.0.0.0 (file version 4.0.20710.0)

What else should I look at.

1
Do you still use XAML build in TFS 2015? Why do you want to copy the referenced dlls to drop location?Cece Dong - MSFT
We have a customized deploy system. We build on our build-agent servers, and push content to development/testing/production servers. The target servers likely do not have the same components installed. Incidentally, it seems the new MS/Visual Studio pattern (especially with core) is to include all binaries when building/deploying rather than relying on the GAC. Hopefully MS addresses this issue in the near future.davewilliams459

1 Answers

1
votes
  1. Since you have upgraded to TFS 2015, it's suggested to use the new build system which is completely different from XAML build. Check: https://www.visualstudio.com/en-us/docs/build/overview

  2. It seems you are still checking in the referenced dlls to TFS, which is not suggested. Instead, we suggest restore the packages via a package manager such as NuGet. Check "Migrating to automatic restore" at website https://docs.nuget.org/ndocs/consume-packages/package-restore#msbuild-integrated-restore

  3. If you start to use new build system, you can simply include the Restore NuGet Packages task in the definition before any build task. Detailed information of Nuget Package Restore, please check https://docs.nuget.org/ndocs/consume-packages/package-restore

enter image description here