Unable to configure a VisualStudio task in Bamboo to successfully build a Solution
Asked by Nichaladas:

I am trying to setup a VisualStudio task to compile our source code, which is a mix between C++ and Fortran code. We are able to compile our code on the command line by executing:

C: Program Files (x86) Microsoft Visual Studio 9.0 Common7 IDE [devenv.com](http://devenv.com) Solution.sln Build Release\|Win32

When I try calling a VisualStudio task with the following settings:

Solution: Solution.sln

Options: '/Build Release\|Win32'

Platform: x86

Environment Variables: \<list of="" required="" env="" variables=""\>

I get the following:

Beginning to execute external process for build 'SADM - Branch 5.2.0 - Win32 Build'

... running command line:

E: bamboo-home DotNetSupport devenvrunner.bat

E: bamboo-home xml-data build-dir SDM-BR520-JOB1

C: Program Files (x86) Microsoft Visual Studio 9.0 x86

Solution.sln

/Build Release\|Win32

... in: E: bamboo-home xml-data build-dir SDM-BR520-JOB1

... using extra environment variables:

MAS3P=E: mas3p

FLEXNET_BASE=E: 520_branch sadm-utilities-x64 flexnet-publisher-11.9.1

MATLAB_VERSION_32=C: Program Files (x86) MATLAB R2010a

16-Oct-2012 16:29:16 'Win32' is not recognized as an internal or external command,

16-Oct-2012 16:29:16 operable program or batch file.

The problem is devenvrunner.bat is interpreting the \|Win32 as a pipe command to the Win32 program, which fails.

I would rather being able to call [devenv.com](http://devenv.com) directly, instead of using devenvrunner.bat. I thought I could achieve this by adding a new executable to the Visual Studio task, so I created one called Devenv with value C: Program Files (x86) Microsoft Visual Studio 9.0 Common7 IDE [devenv.com](http://devenv.com)

However, when the task has this executable selected (Task Executable says: Devenv instead of Visual Studio 2008) Bamboo still calls the devenvrunner.bat. I'm not sure if this is the correct behaviour. Otherwise what is the difference in setting the Executable to use?

I hope I have provided enough information so that you can help me.

<br />


Answers:
author: Nichaladas
body: Update: I received a response from a support member, [Armen Khachatryan](https://support.atlassian.com/secure/ViewProfile.jspa?name=akhachatryan).

His response is given below:

Thanks for the update. Are you running your Bamboo server and remote agent (if you use one for this plan) as windows service or from command line? Can you please try both? Also, make sure to use a local admin user when you run it as a Windows service as per [this document](https://confluence.atlassian.com/display/BAMBOO/Running+Bamboo+service+on+Windows+as+the+local+user). Let me know if that makes any difference.

Cheers,  
Armen

The answer was to ensure the Bamboo server windows service was running as the local admin account, instead of a SYSTEM account. The instructions to do this are on the website linked in his response. I also had to use a script task and call [devenv.com](http://devenv.com) directly, instead of using the VisualStudio task.


author: SimonS
body: Very good writeup Nick. If you don't get any answers here, you should also try our support team at <https://support.atlassian.com>


Tags: visual-studio