Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

*.dll.licenses file in obj directory not created with msbuild in TeamCity

I am working on upgrading our TeamCity projects from VS2012 to VS2015 and I am running into an issue compiling our MVC application.

Old MSBuild (v4.0.30319.34209) generates a file in the obj directory called MyApplication.Web.Mvc.dll.licenses which apparently is required for building, but we have no idea what the file is actually used for.

New MSBuild (v14.0.23107.0) does not create this MyApplication.Web.Mvc.dll.licenses file, so the build fails with the following error:

CSC error CS1566: Error reading resource 'MyApplication.Web.Mvc.dll.licenses'  -- 'Could not find file 'C:\BuildAgent\work\58ddf5f1234d8c8a\application\MyApplication\MyApplication.Web.Mvc\obj\Release\MyApplication.Web.Mvc.dll.licenses'.'  

I have been running the builds manually via cmd on the machine, and the dll.licenses file gets created whenever running the build using the old msbuild, just not the new one.

The file gets created on the development machines running VS2015, but not on the Teamcity build server. So it seems to me that something else is out of date?

like image 911
gwin003 Avatar asked Sep 03 '15 13:09

gwin003


2 Answers

After a bit more googling, I stumbled upon this thread on MSDN.

The solution suggested here is to install the Windows 10 SDK. We did this on our TeamCity build server running Windows Server 2012 R2 using the default installation options, and after a reboot, our build was working again.

Hope this helps :)

like image 97
Njål Nordmark Avatar answered Oct 02 '22 20:10

Njål Nordmark


The answer "Install the Windows 10 SDK" is correct - basically. But there is an additional pitfall: There is more then one version existing of this SDKs: https://developer.microsoft.com/en-us/windows/downloads/sdk-archive

By the writing of this comment:

  • July 2015 (Version 10.0.26624.0) contains .NET Framework 4.6 SDK
  • Nov. 2015 (Version 10.0.10586.212) contains .NET Framework 4.6.1 SDK
  • Aug. 2016 (Version 10.0.14393.0) contains .NET Framework 4.6.2 SDK

Check your VS 2015 output and what version of LC.exe is called. Then install the appropriate SDK on the build server. Don't forget to install Microsoft Build Tools 2015 too.

Note: My build is targeting .net 4.5, but above is needed to build on TeamCity with 2015 tools.

like image 44
Alois Maierhofer Avatar answered Oct 02 '22 21:10

Alois Maierhofer