Friday, 24 August 2012

Building .Net 4.5 Projects with Jenkins









In my day job for Specialmoves we use Jenkins as our continuous integration server.

Today, after upgrading one of our projects to target .Net 4.5, a colleague of mine was complaining  that the Jenkins build for the project was failing with the following error.

warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed.

He had already tried installing .Net 4.5 on the Jenkins server, which hadn't fixed the problem.
















Chuck Norris was not amused....... 


















(if you haven't installed the Chuck Norris plugin for Jenkins, i suggest you do so immediately. It wont fix your problem, but it will make you laugh)

The first thing we had to do was to install the Windows SDK for Windows 8 on the Jenkins server. This 
includes the .NET Framework 4.5 SDK


After installing the SDK, we kicked off the build again, only to be greeted with a different error.

error MSB4019:  The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk

To fix this error we copied the missing Visual Studio 2012 msbuild folder from a machine that actually had Visual Studio 2012 installed.

So copy C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\ from a machine that has Visual Studio 2012 installed, to the same location on the Jenkins server.

Once you've done this, Jenkins should be able to build the project.

Chuck Norris is happy again.



8 comments:

  1. Great post indeed. I really like that you are providing information on .NET for freshers , Being enrolled at http://www.wiziq.com/course/57-fresher-training-projects i found your information very helpful indeed. Thanks for it.

    ReplyDelete
  2. Thanks! I just experienced the same problem. I think after I follo wyour steps, I'll be ok...

    ReplyDelete
  3. Thanks, Chuck in indeed happy again :)

    ReplyDelete
  4. Thank you kind sir or madame! ;)

    ReplyDelete