3

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.

Derek Evermore
  • 1,418
  • 1
  • 10
  • 22
  • Is there a specific reason why you EXEC devenv.exe to build your solution instead of using the [MSBuild task](http://msdn.microsoft.com/en-us/library/z7f65y0d%28v=vs.90%29.aspx)? – Filburt Feb 17 '12 at 14:57
  • I am not 100% certain about this because this was implemented by a previous Biztalk administrator. However, I believe that to build Biztalk 2009 solutions with pipelines, orchestrations, etc you have to build them using Visual Studio. (Much like you must build Visual Studio setup projects by exec'ing out to devenv.exe.) – Derek Evermore Feb 17 '12 at 15:18
  • I'm using the MSBuild task to build my BizTalk projects (not the solutions) and it works fine. From what I've seen setup projects may be a different bunch. – Filburt Feb 17 '12 at 15:29
  • If I where you I'd give it a shot using the MSBuild task - it wouldn't require much change but you can exclude VS as a possible source of error. – Filburt Feb 17 '12 at 22:23
  • I would look into the BizTalk Deployment Framework which will fix your issues. Also look here for a hotfix to VS2008 http://intovsts.net/2009/09/17/mstest-exe-exited-with-code-2146233082-during-team-build/ – Bryan Corazza Feb 18 '12 at 00:17

1 Answers1

1

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.

Filburt
  • 17,626
  • 12
  • 64
  • 115
  • We are using the BTDF already. This step performs the compile prior to the BTDF doing the MSI creation. I'm quite familiar with using the MSBuild task to invoke builds but I was under the impression we needed to use visual studio to perform the compilation. As that does not seem (from what ppl are posting here) to be the case I'll give it a shot this week and see if a straight MSBuild task to compile everything works. – Derek Evermore Feb 19 '12 at 20:07