TeamCity 2019.1 Help

Visual C Build Issues

If you experience any problems running Visual C++ build on a build agent, you can try to workaround these issues with the following steps, sequentially:

  • Make sure you do not use mapped network drives.

  • Make sure build user have enough right to access necessary network paths

  • Log on to the build agent machine under the same user as for build and try running the following command:

    msbuild.exe <path to solution.sln> /p:Configuration:Release /t:Rebuild
  • Build Agent service runs under the user with local administrative privileges

  • Make sure Microsoft Visual Studio is installed on the build agent

  • You have to start Visual Studio 2005 or Visual Studio 2008 under build user once

  • If Error spawning cmd.exe appears, you should put the following lines exactly into the list in Tools -> Options -> Projects and Solutions -> VC++ Directories:

    --$(SystemRoot)\System32 --$(SystemRoot) --$(SystemRoot)\System32\wbem
  • You need to add all environment variables from ...\Microsoft Visual Studio 9.0\VC\vcvarsall.bat to environment or to Build Agent Configuration

  • Try using devenv.exe with Command Line instead of Visual Studio (sln) build runner

  • Ensure all paths to sources do not contain spaces

  • Set VCBuildUserEnvironment=true in the runner properties

  • Specify the VCBuildAdditionalOptions property with value /useenv in the build configuration settings to instruct msbuild to add the /useenv commandline argument for spawned vcbuild processes.


See also:

Administrator's Guide: .NET Testing Frameworks Support | NUnit support