Tuesday, June 12, 2012

BizTalk: Errors exist for one or more children

When I was converting BizTalk 06 into BizTalk 2010 I ran into a number of strange errors that didnt make much sense. On the top of this list was the following:

#error: "Errors exist for one or more children." 

So helpful, right? When you look for the line in the orchestration that this error is coming from(and it always seems to be an orchestration) you are typically pointed to a snippet of code in a shape that seems totally innocuous. Here are the tricks I have used to get rid of the error:

1) First Delete the offending line of code in the shape and save. Then attempt to build the solution/project and let the build fail(this time because the shape is empty). Lastly, add back the line of code you deleted, save and build again. This sometimes works.


2) If you can find it, delete the generated odx.cs file. These tend not to exist as such in later versions of Biz but in 06 they do, and in 09 I believe its File01.cs. This is because the generated .cs files can be a source of problems if they aren't generated correctly. 


3) Look in the odx file as text and search for the error there("Errors exist for one or more children.") sometimes it will be near the bottom. Delete it and try to rerun. 


4) Add some whitespace or a newline after the offending code, and try to recompile after that. Restarting visual studio is another option.

If you see other errors from Biz that you cant make sense of perhaps it is covered here:


Friday, June 1, 2012

msbuild, devenv, Powershell, and the man in the yellow hat.

Powershell has its pluses and minuses for sure. I couldn't seem to make much sense of how to use msbuild, or devenv for that matter, but I did piece together some things I found online and thought I'd share what I learned.

'msbuild.exe Solution.sln /t:build' 

can be done in powershell and you can replace msbuild.exe and Solution.sln with variables like so:

> $msbuild = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
> $sln = "Solution.sln"
> $build = $msbuild + " ""$sln"" "
> Invoke-Expression $build

I'm unsure how evaluation is done and so I dont know why double quotes are needed around $sln, though I do suspect one set is for an escape of some kind.