Include Search Paths in TeamCity build Configurations?

First, you should try to compile the solution yourself with msbuild or vcbuild on the command line, because TeamCity will do something similar. If necessary, add msbuild folder to the Path system variable. Then open the command line and type.

Up vote 1 down vote favorite share g+ share fb share tw.

Normally when a Developer compiles a certain mixed C++/C# solution locally on their machine at our company, they employ the use of a . Vssettings configuration file. One of the things included in this config file is reference to various directory paths for Lib and Include files.

However, our buildAgent machines (using TeamCity) are set up to be sterile, and have the bare minimum installed on them required to build any given solution/project. This means the above exampled mixed C++/C# project won't have access to the IDE's configuration where things like include search paths were set. TC accounts for this by allowing you to set all sorts of variables for any given buildConfiguration (or even by buildAgent).... But how do I get an Include search path to WORK in TC?

I'm copying down from Source Control (Perforce) a copy local of what I want Included (1), and then trying to define an Environment Variable (2) -- and yet TC fails the build (3). I'm sure I have something configured wrong, but for the life of me cant figure out what! Any help would be most appreciated, blong (1) VSC Client Mapping - Perforce //depot/OpenSource/Boost-1.33.0/boost/... //team-city-agent/OpenSource/boost/... (2) buildConfig Environment Variable definition env.

Include = %system.teamcity.build. CheckoutDir%\OpenSource (3) TC build log snippet 16:57:39: Project "xxx. Sln" (Build target(s)): e:\buildagent\work\ef1853a454da9d94\xxx\rowsbase.

Cpp(5, 0): error C1083: Cannot open include file: 'boost/dynamic_bitset. Hpp': No such file or directory continuous-integration teamcity link|improve this question asked May 20 '09 at 14:40blong.

First, you should try to compile the solution yourself with msbuild or vcbuild on the command line, because TeamCity will do something similar. If necessary, add msbuild folder to the Path system variable. Then open the command line and type: msbuild.

Exe YourSolution. Sln or msbuild. Exe YourSolution.

Sln /p:Configuration=Release depending whether you want to do so in debug or release mode. This should give the same C1083 errors. Here's the fix: Add the path of the directories you need to add an environment variable (in fact, system variable) that I suggest you call INCLUDE.

Open the file VCProjectEngine.dll.config. Xml in folder .../Microsoft Visual Studio 9.0/VC/vcpackages/. Add the INCLUDE system variable to the include line.

To me it came to replacing: Include="$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)\include;$(FrameworkSDKDir)include" with: Include="$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)\include;$(FrameworkSDKDir)include;$(INCLUDE)" Test it works: Open a new command line (need to after you change environment variables for them to be taken into account) and try to build your solution as shown above. This has worked for me to build C++ solutions with files that #include . Now let's have it work in TeamCity too.

You can run a TC build at this point to see whether it does, but it didn't for me. Go to the "Properties and environment variables" of your TC build configuration, and add an environment variable named INCLUDE with value the same path(s) as in the INCLUDE system variable above. Now this should work.

Hope it helps.

Accept this guy's the answer. It just worked for me. – dario_ramos Dec 30 '11 at 14:38.

I ran into a problem were my C++ projects would build in Visual Studio on the build agent, but they failed when built through TC. The build agent is running windows and agent is running as a service (TeamCity Build Agent Service). The problem was that the service was being run as "Local System" instead of the user that configured Visual Studio.

I change service so it would log on as the "build" user and everything worked fine.

Setting the Build Agent Service to run as a non "local System" account fixed my problem. Thanks.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions