To build Biztalk 2009 projects as part of a TFS 2010 team build I am using a MSBuild exec task to shell out to VS2008 devenv.exe like so...
<Exec Command=""$(BuildMachineLoc)devenv.exe" "$(BiztalkSolutionPath)" /Build "$(BuildFlavor)" /out "$(DropLocation)\$(BuildNumber)\CoreBiztalkBuildOutputLog.txt""/>
This works properly around 95% of the time. Randomly, however, the build will fail with the following error in the log. (I edited this slightly to omit the names of the services I am building)
Build FAILED.
MSB3073: The command ""C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" "[path to my solution]" /Build "Release" /out "[path to my drop location]\CoreBiztalkBuildOutputLog.txt"" exited with code -2146233082.
If you check the CoreBiztalkBuildOutputLog.txt file it shows that everything builds succesfully. If you compare this log for a failed build to a build which succeeds they are identical.
Code -2146233082 is not very descriptive... so I found the actual exception from the event viewer on the build machine.
Event Type: Error
Event Source: .NET Runtime
Event Category: None
Event ID: 1023
Date: 2/17/2012
Time: 2:58:41 AM
User: N/A
Computer: XXXXXXXX
Description:
.NET Runtime version 2.0.50727.3625 - Fatal Execution Engine Error (7A0BC59E) (80131506)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
A little poking around on the net indicates that this is a CLR error of some kind. Suggested solutions are to reinstall\repair the .NET framework. That seemed to make sense as the build machine I was using previously was a 7 year old dinosaur which has had various issues for as long as I've owned it. (~2 years)
I ended up provisioning a new VM to run my Biztalk 2009 builds so I could retire that old, physical server completely. Much to my chagrin, however, I am finding that I encounter this same random CLR error on the new server around 5% of the time.
Based on this I am guessing is that this is some sort of defect in the .NET framework which I won't be able to fix. But if anyone has any ideas I am all ears.