Environment: TFS 2012 build agent running on a Windows Server 2012 VM. .Net 4.0/.Net 4.5 installed. The Windows SDK (http://msdn.microsoft.com/en-us/library/ms717422.aspx) has also been installed.
Issue: The build agent cannot build .net 4.0 web applications developed using VS 2012.
The build fails because it cannot resolve the web targets:
Error 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 declaration is correct, and that the file exists on disk.
Additional warnings then follow: The reference assemblies for framework ".NETFramework,Version=v4.0" 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. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
I searched for .NET 4.0 targeting packs here:
http://msdn.microsoft.com/en-US/hh487283.aspx
but Windows Server 2012 is not listed as a supported platform.
The IT infrastructure team are not keen on installing VS on each build agent VM just to get a targeting pack.
Does anyone have any ideas as to how I might resolve this?