Search This Blog

Monday, September 29, 2014

Microsoft.WebApplication.targets" was not found error when building VS 2012 solution on Jenkins build server


Encountered an odd error in an automated build.
One solution was failing with this error:

Here is the error:
The imported project "E:\Build\RXS\external\microsoft\Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. E:\Build\RXS\DirectAdministrativeApplication\service\config.service.VS2012.csproj


Open the solution locally (not on the build server) no problem.
Open the solution on the build server, one project failed to load....
Ah, a missing reference perhaps....

Based on this link:


I copied the project file
And changed the following V9.0 to V11.0
These are the imports in the .proj file:
 
  v9.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />

  v9.0\WebApplications\Microsoft.WebApplication.targets')" Project="..\..\external\microsoft\Microsoft.WebApplication.targets" />

The build machine never had VS 2008 installed on it but the reference in the project came off a dev machine and was only missing off.

Lucky blind guess worked....
Solution opens and builds now.