Creating a WCF Library on a CI Machine

UPDATE:

Just an update, since we finally got a license to fix and install Visual Studio 2012 on our build agent. As soon as we finished the installation, everything was built perfectly.

Thank you all for your answers and help. The answer I accepted listed this option as the fourth one to try, and we tried everything else, and that was all that made it build.

Help when I try to create 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, however I use VS2012 on my machine. Is there an SDK that I can install, or do I need to install VS2012? It is also a teamcity task that simply launches MSBuild in the solution file.

+4
source share
2 answers

If the CI environment does not have "necessary", then I found several permissions:

One: install the SDK (as mentioned earlier).

Two: from time to time you can copy the ".targets" file manually from a computer with VS20xx installed on it. This is actually a good scenario as it is a simple fix.

Example here: Microsoft.WebApplication.targets not found on the build server. What is your decision?

Three: something akin to installing an SDK. Extra package here or there. Here is an example:

Build error in tfsbuild with database project

Four: Microsoft pinches you from time to time. And your only regression is to install a full-fledged Visual Studio. I hate it because the CI machine doesn't need Visual Studio.

+4
source

One thing to check is to determine if this link is required.

I had a 2012 solution with a .csproj file that contained a link to Microsoft.VisualStudio.ServiceModel.targets. I upgraded from VS 2012 to VS 2013. I had two machines, which I will call DESKTOP and LAPTOP. DESKTOP had VS 2012, and I installed VS 2013 too. Therefore, the following file existed, and I was able to compile my solution:

 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\WCF\Microsoft.VisualStudio.ServiceModel.targets 

I did not have VS 2012 on LAPTOP. I installed 2013 from scratch and tried to get my solution (which is managed by the TFS source). I got the indicated error (VisualStudio.ServiceModel.targets does not exist ... confirm the declaration is correct).

Turns out I donโ€™t even need this file. In my .csproj file on DESKTOP, I simply commented out an element and the solution was recompiled (including with passing unit tests). So I checked it in TFS from DESKTOP, got the latest LAPTOP code and compiled (and unit tests):

 <!-- Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\WCF\Microsoft.VisualStudio.ServiceModel.targets" / --> 
+3
source

All Articles