Simply a minor facepalm moment I want to document to help both myself and others avoid unnecessarily wasting an hour. Like I just did…
You’re attempting to perform a ‘Validate Instance’ of a document against the .xsd schema definition, and receiving the following error:
C:\path\to\sample\data.xml: warning BEC2004: Root element is missing.
Step 1: Make sure to close Excel/TextEdit/whatever external program is preventing Visual Studio from obtaining an exclusive lock on the sample file.
Step 2: Step away from the keyboard, grab a cup of tea and some air. You need it…
Further to a question I recently answered on StackOverflow, I wanted to expand a little on when it is necessary to restart a BizTalk Host Instance, and when this is overkill.
Host Instance restart required
Any change to an underlying datatype, map or orchestration will require a restart of the corresponding Host Instance. This is due to the way the .Net runtime manages type-loading of assemblies.
All BizTalk schemas, maps and orchestrations are compiled to .Net code inside an Assembly. The .Net runtime supports dynamic loading and type-discovery of Assemblies, but does not support removal or un-loading. This means that any time you change any code-based .Net artefact, a Host Instance restart is required before the change will be seen.
Runtime Configuration change
The counter to this is Configuration based runtime artefacts, including the configuration and binding of BizTalk Adapters. For example, it is possible to change the path and file-mask properties of a File based Receive Adapter, or even change from using a File Receive Adapter to a SQL Receive Adapter within the same Receive Port, with the chage reflected immediately, and with zero down-time.