“Random” .NET Runtime error when building Biztalk 2009 solutions at the command line using VS2008 devenv.exe

StackOverflow https://stackoverflow.com/questions/9339914

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="&quot;$(BuildMachineLoc)devenv.exe&quot; &quot;$(BiztalkSolutionPath)&quot; /Build &quot;$(BuildFlavor)&quot; /out &quot;$(DropLocation)\$(BuildNumber)\CoreBiztalkBuildOutputLog.txt&quot;"/>

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.

有帮助吗?

解决方案

If you want to give the MSBuild task a try, here's the translated task from your example:

<MSBuild Projects="$(BiztalkSolutionPath)"
    Targets="Build"
    Properties="Configuration=$(BuildFlavor);" />

Since it's not clear from your example whether $(BuildFlavor) determines the Configuration or the Architecture property you may have to change this according to your needs.

The OutputPath would be set at project level - I personally use the MSBuild task Output Taskparameter to grab the assemblies built. When deploying to BizTalk (using BTSTask) you can have it copy your BizTalk assembly to your desired directory and wouldn't have to care about it in your build task.

As Bryan suggests it might be worth to take a look at BizTalk Deployment Framework but it's clear that throwing away an otherwise running solution is not an option for you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top