Problems with MSBuild

Hello Guys

My C++ projekt won't compile on my Bamboo testinstallation.
I'm using the msbuildtask with VS 2012. If I run it from a commandline it works fine
If i run it via bamboo it failes with the error

build	26-Aug-2013 18:07:12	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018: The "CL" task failed unexpectedly. [C:\data\bamboo-home\xml-data\build-dir\MYProject-IMB-JOB1\icos\common\common.vcxproj]
build	26-Aug-2013 18:07:12	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(347,5): error MSB4018: System.TypeInitializationException: The type initializer for 'Microsoft.Build.Utilities.FileTracker' threw an exception. ---> System.IO.DirectoryNotFoundException: Das System kann den angegebenen Pfad nicht finden. (Exception from HRESULT: 0x80070003) [C:\data\bamboo-home\xml-data\build-dir\MyProject-IMB-JOB1\icos\common\common.vcxproj]

What I'm doing wrong?

I also created a batch file and run it as SYSTEM User. This also works fine. so it shouldn't be a problem with User rights.

3 answers

1 accepted

1 vote
Accepted answer

Hi

I found the problem. MSBUILD cannot use the default temp directory of Windows 7
Changing the MSBUILD task to an inline task

set temp=c:\temp
set tmp=c:\temp
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /t:rebuild /p:Configuration=Release /p:Platform=Win32 /m /fileLogger cxxx2012.sln

fixes the problem. If I remove the "set temp" commandos it fails again with the same error messages

I'm not shure but the atlassian products have a problem with spaces in the path. Maybe this causes your exception. The MABuild is installt to "C:\Program Files (x86)\"...

Hope that helps

Have you tried running msbuild on the exact same checkout Bamboo is using? Run MSBuild on the files in C:\data\bamboo-home\xml-data\build-dir\MyProject-IMB-JOB1\. Your personal local copy may have an extra file that wasn't included in your Source Control.

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...

5,379 views 21 17
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