TeamCity Cloud 2023.11 Help

Visual C Build Issues

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

  • Make sure you are not using mapped network drives.

  • Make sure the build user have enough rights to access necessary network paths.

  • Sign in to the build agent machine under the same user as that of the build and try running the following command:

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

  • Check that Microsoft Visual Studio is installed on the build agent.

  • Note that you have to start Visual Studio 2005 or Visual Studio 2008 under the build user at least once.

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

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

  • Try using the devenv command of the with .NET build runner instead of the Visual Studio (sln) runner.

  • Ensure all paths to sources do not contain spaces.

  • Set VCBuildUserEnvironment=true in the runner properties.

  • Specify the VCBuildAdditionalOptions property with the value /useenv in the build configuration settings to instruct MSBuild to add the /useenv command-line argument for spawned VCBuild processes.

See also:

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

Last modified: 04 March 2024