Building WCF Library on CI Machine
c#, msbuild, visual-studio-2010, visual-studio-2012, wcf
Solution
When the CI environment doesn't have the "necessaries", then I have found a few resolutions:
One : Install the SDK (as previously mentioned).
Two : Every once in a while, you can copy the ".targets" file over manually from a machine with VS20xx installed on it. This is actually a good scenario, in that it is an easy fix.
Example here: Microsoft.WebApplication.targets was not found, on the build server. What's your solution?
Three: Something "akin" to an SDK install. An extra package here or there. Here is an example:
Build error in tfsbuild with database project
Four : Every once in a while, Microsoft screws you. And your only recourse is to install the full fledged Visual Studio. Which I hate, because a CI machine shouldn't need Visual Studio.
Problem
UPDATE: Just an update as we finally got our licensing fixed and installed Visual Studio 2012 on our build agent. As soon as we finished the install everything built perfectly. Thank you everyone for all your answers and help. The answer I accepted listed this option as the fourth one to try and we did try everything else and this was all that made it build. Help when I try to build a WCF library project on my Windows Server 2008 R2 build machine I get this error: ``` C:\BuildAgent\work\e8ce1d5b0f26c529\Configuration\ECUWeb\EcuWeb.ServiceLib\EcuWeb.ServiceLib.csproj(90, 3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\WCF\Microsoft.VisualStudio.ServiceModel.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. ``` Project Configuration\ECUWeb\EcuWeb.ServiceLib\EcuWeb.ServiceLib.csproj failed. The build agent has visual studio 2010 and .net4.5 installed however I am using VS2012 on my machine. Is there an SDK I can install or do I have to install VS2012? Also this is a teamcity task that just runs MSBuild on the solution file.