I use the BizTalk Deployment Framework (BTDF) a lot for deployment of BizTalk solutions.
BTDF is using MSBUILD tasks to deploy a assembly.
Last week we found a problem with deployment of a specific solution. The problem was MS-BUILD was not performing as expected.
We had a task that looked like this…..
<Exec
Command=”"$(BtsDir)Trackingbm.exe" add-account -View:"%(BAMViewsAndAccountsGroup.viewName)" -AccountName:"%(BAMViewsAndAccountsGroup.groupNames)"”
ContinueOnError=”true” Condition=”‘$(BAMViewsAndAccounts)’ != ””/>
The command would fail but since ContinueOnError was set to true the build would continue as if nothing had happened.
However… This build above was called by another build. And the original toplevel build would still fail !!!
I have looked everywhere and after a lot of googeling finally I found that the MsBuild task EXEC is by default MULTILINE….
This solved my problem very quickly. I changed the command to:
<Exec
Command=”"$(BtsDir)Trackingbm.exe" add-account -View:"%(BAMViewsAndAccountsGroup.viewName)" -AccountName:"%(BAMViewsAndAccountsGroup.groupNames)" > null
Exit 0”
Condition=”‘$(BAMViewsAndAccounts)’ != ””/>
And now the build complestes with succes.
Not the most elegant solution but it does the job…