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.

Regards,

Marc

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

https://confluence.atlassian.com/display/BAMBOO/Creating+a+custom+elastic+image+-+Windows

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
Community showcase
Asked Thursday in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

468 views 2 5
View question

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