Bamboo builds can't find the Visual Studio executable and throw "The system cannot find the path specified."

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Bamboo can't find the Visual Studio executable during a build and the build fails, showing the following error in the logs:

The system cannot find the path specified.

Environment

All supported versions of Bamboo, configured with Visual Studio.

Diagnosis

Builds fail and the following errors can be seen in the build logs:

Build logs
build	14-Jul-2022 15:48:27	<bamboo-home>\local-working-dir\PLAN-PROJ-JOB>call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\VC\vcvarsall.bat" x86_ia64 
error	14-Jul-2022 15:48:27	The system cannot find the path specified.
build	14-Jul-2022 15:48:27	
build	14-Jul-2022 15:48:27	<bamboo-home>\local-working-dir\PLAN-PROJ-JOB>call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Common7\IDE\devenv.com"  "script.sln" /build Debug 
error	14-Jul-2022 15:48:27	The system cannot find the path specified.

The following line shows that there's an issue with the executable path defined in Bamboo. For this example, the Common7 directory is duplicated.

build	14-Jul-2022 15:48:27	<bamboo-home>\local-working-dir\PLAN-PROJ-JOB>call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Common7\IDE\devenv.com"  "NOSS.sln" /build Debug  

Cause

The Bamboo DevEnv script (used by the Visual Studio task) tries to run either %BAMBOO_VISUAL_STUDIO_HOME%\VC\Auxiliary\Build\vcvarsall.bat or %BAMBOO_VISUAL_STUDIO_HOME%\VC\vcvarsall.bat, whichever exists first.

This issue can happen if the %BAMBOO_VISUAL_STUDIO_HOME% variable (which comes from the Visual Studio capability in Bamboo) is set with extra paths beyond the default Visual Studio location.
For example, C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7.

Solution

Adjust the Visual Studio executable capability in Bamboo to reflect the correct Visual Studio home directory. Capabilities can be defined in several ways, as described on this page:

Server capability/executable

 • Cog icon > Overview > Executables > select the Visual Studio one, click Edit, and adjust the path.

Agent capability

 • Cog icon > Agents > open the agent affected by this issue > Capabilities > select the Visual Studio, click Edit, and adjust the path.

Manually set using the bamboo-capabilities.properties file

If the Visual Studio capability was hardcoded in the agents using the capabilities file, please see the steps on the article below to update the path:



Last modified on Dec 14, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.