Posted by: Stephen Oakman | July 14, 2010

TeamCity, VS2010 and Embedded Resources

We hit an issue recently with switching to Visual Studio 2010 for all our projects and running the 2010 solution file directly from the TeamCity build runner. The issue was highlighted by a failing test which only failed on the build server.

To give more context, we have projects started in Visual Studio 2008 being built using TeamCity. When moving to Visual Studio 2010, we introduced a new 2010 solution with references to all the existing projects. We then continued to use the 2008 solution for TeamCity builds. Although not ideal, it worked.

With a recent release of TeamCity, and with some pain with introducing new projects to the 2010 solution (and forgetting to add them to the 2008 solution – oops) we bit the bullet and worked towards building directly from the 2010 solution.

Anyone that has gone down this same path will have hit the issue regarding TeamCity not being able to find MSBuild. There’s a couple of ways around this, one of which is to install Visual Studio 2010 on the build server. Don’t worry – that thought never even entered into our minds. Another solution (and the one we went with even though I was trying to fight it and override the TeamCity environment varaibles) is to install the windows and .net sdk and the run the command line options (described here).

This enabled the solution to actually compile, but we got that one failing test.

The fix we used here was to set a system property in TeamCity to specify the location of AL.exe. In TeamCity, navigate to your build project, select Edit Configuration Settings and then Properties and Environment Variables. Then add a system property called ALToolPath with the value ‘C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin’. This then uses the right version of AL.exe for a .Net 3.5 project.

Hopefully this will save someone some time.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: