Ive just been working on upgrading the build generator to support BizTalk 2009 projects. While doing this one of the things i wish to do is to change the compile step to use MsBuild rather than dev env.
I found a little issue which others who use MsBuild may come across when migrating custom scripts.
Previously for BizTalk 2006R2 scripts I used to use the below command:
<Exec Command='"$(DevEnvPath)" $(SolutionName) /Build $(ConfigurationName)' />
This would compile the whole solution using devenv.
I changed the script to the following:
<MSBuild Projects ="$(SolutionPath)" Properties="Configuration=$(ConfigurationName);" />
and also changed the property on the project to useToolsVersion="3.5"
This is how I expected the build to need to be and it would mean our script would take advantage of using the MsBuild task inline. When I ran the script I get the following error:
"Solution file error MSB5014: File format version is not recognized. MSBuild can only read solution files between versions 7.0 and 9.0, inclusive"
My initial thoughts made me think this was more complicated than it actually was. I was looking at using the Exec command rather than the MsBuild task for the compile which I could get to work. Then suddenly the answer hit me.
The problem was that I forgot that the .cmd file I use to call the MsBuild file was configured to use the v2.0 version of MsBuild rather than 3.5. As soon as I corrected this it worked fine.
So if you have the above error remember to double check the original call to start your build script wether it be from TFS/Cruise Control or a custom file etc.