MSBuild task fails in Bamboo

Our company has an Atlassian Cloud subscription and we want to automate our product's build process with Bamboo but we have some troubles with it.
We use MSBuild 12.0 to build Visual Studio 2013 solution on the Windows Server 2008 64bit. We use bamboo user to run tasks via bamboo agent, who doesn't have administrative permissions.

When we run MSBuild manually from the command line, while logged in Windows instance via Remote Desktop Client everything is fine, but if we run same command as a task it fails in two different places:
1) First error occuires during ClickOnce signing.
(_DeploymentComputeClickOnceManifestInfo target) -> 
C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(3450,5): error MSB3482: An error occurred while signing: Failed to sign <...\path\...>\<ApplicationName>.exe. SignTool Error: An unexpected internal error has occurred.[C:\build-dir\<...\path\...>\<ApplicationName>.csproj]
2) Second error occuires during InstallShield installer creation.
(Build target) -> 
C:\Program Files (x86)\MSBuild\InstallShield\2013Limited\InstallShield.targets(108,3): error : -7159: The product license has expired or has not yet been initialized. [C:\build-dir\<...\path\...>\<ApplicationName>\Setup\Setup.isproj]

The only difference that we found between these two methods is environment variables values. HOMEPATH and HOMEDRIVE variables are empty in the task mode, but they have values in logged mode.
What can cause these kind of errors? We want to understand differences between Bamboo agent and normal command line.

2 answers

Hi Alexan,

Did you configure the Bamboo agent software to run as a windows service? I bumped into a similar issue a while ago in Jenkins when using a slave configured as windows service.



I configured with Task Scheduler, run agent as batch command.

Seems there was guy who had same problem:

A follow up to Mark's comment is that the environment variables TEMP & TMP are both set to c:\windows\temp on the EC2 Intance of Windows Server 2012 R2.  This causes all kinds of pain with Visual Studio 2013 and MSBUILD 12.0 .  I had to set these to a writable location as the Windows folder is protected.  Wasted lots of time trying to figure why my builds failed when launched from bamboo, but worked via command line on the EC2 Image.


Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,814 views 0 6
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you