Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Standard language features missing when running build

I have a powershell script that runs msbuild just fine to build a .NET application in a stnadard powershell window.  When I run the same script from bamboo, C# language features are missing.  E.g. "The type or namespace name 'List<>' could not be found."  What needs to be done to have the script run "normally" from bamboo?

Thanks,
Jay

1 answer

0 votes
Jeyanthan I Atlassian Team Jun 11, 2020

Hi Jay,

As you say that you are able to execute the same script from PowerShell, it is possible that you are running the Bamboo agent as a different user in Windows (especially if you are starting the agent as a service, you might be running as LOCAL SYSTEM user and this user account has a different environment and home).

Is it possible for you to switch the user account as which the service is running to run as a local user as which you start via console? The process to switch to a local account is explained in this page.

If you have recently upgraded Bamboo to 6.10 or above, you may also want to update the agent wrapper. This is stated in the Bamboo 6.10 "Version-specific upgrade notes" section of the Bamboo upgrade guide and it is possible that this might have been missed. I will add the same below for reference:

Remote agent wrapper update

To address some knows issues, we updated the Tanuki wrapper used for Bamboo remote agent. Bamboo 6.10 is released with new version of the wrapper. If you're an upgrading user, we strongly recommend that you reinstall the wrapper to benefit from all bug fixes.

To update the wrapper on a remote agent:

  1. Stop the original agent.
  2. Backup the BAMBOO_AGENT_HOME/conf/wrapper.conf file.
  3. Remove the BAMBOO_AGENT_HOME/conf directory.
  4. Download a new Remote Agent JAR from your Bamboo Server: http://<BAMBOO_URL>/admin/agent/addRemoteAgent.action.
  5. Launch the remote agent.
  6. This will create a new wrapper.conf file. If you want to re-enact your custom configuration in that file, you can do it now. 

Hope that helps. Please share the outcome with us.

Cheers,
Jey

Indeed it was the user that bamboo was running withing Services.  You have to make sure Visual Studio will build the project under a user that bamboo is running as.

Thanks!
Jay

Thanks for your update, Jay. I'm afraid it isn't clear to me if your Bamboo server is running as a Local User instead of Local System already and if you are seeing this when running on a remote agent or on a local agent. I wrote an article on the same explaining the need:

Also, did you do a Bamboo upgrade recently? If so, you may have to run the agent wrapper update as I pointed earlier.

That being said, as you see that the same command works via console, I'm confident that this issue will not be seen when you start Bamboo via console by running <bamboo-install>\bin\start-bamboo.bat or your agent via <bamboo-agent-home>\bin\StartBambooAgent-NT.bat

Cheers,
Jey

Hi Jey,

We are using a new install of  Atlassian Bamboo version 7.0.4 build 70018 - 14 May 20

We have to run as a local user, not local system, in order for the build to work: i.e. to see C# basic features such as Int32 and System, etc.

I found that /t:Restore is perhaps the main missing feature and not having it is the cause of my issue in general.  Here is the full list of MSBuild flags/parameters that work for me.

/t:Rebuild /t:Restore /p:Configuration=Release /p:AppxBundle=Always /p:AppxBundlePlatforms="x64" /p:Platform=x64

Jay

P.S., Jey,

I have not tried your suggestions for starting Bamboo.  I didn't set it up, our Admin did.  

Jeyanthan I Atlassian Team Jun 30, 2020

Thanks for clarifying. I trust the suggestion I have proposed worked for you.

Cheers,
Jey

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo Data Center is here!

G’day Bamboo customers, The wait is over! Bamboo Data Center edition you have been asking for is finally here! This self-managed enterprise offering of Bamboo has the resilience, reliability, and s...

546 views 1 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you