Thursday, November 14, 2013

Failed to start the BizTalk Host instance. Check the event log on the server for more details.

Have you done any changes to BizTalk config file recently. Can you open the file in any XML editor any check it has any format error. Also check for a custom entires, which may not be vaild. I would have taken backup of the config files before any chances, if you have then compare the changes. If you have done some changes make sure you have done them in the 64bit config files.

Thursday, November 7, 2013

System.Xml.XmlDocument is not marked as serializable in BizTalk

XmlDocument is not a serializable type.

     This error usually occurs when an orchestration (which uses any of your assembly that has XmlDocument type field) is going to be dehydrated, the BizTalk engine is going to serialize every variable.

     This won't apply to variables that are of the XmlDocument type in the orchestration as BizTalk knows it's not serializable and won't try. Because this is so widely used that it is treated as a special case. The BizTalk Engine knows how to serialize it so the XLang compiler doesn't raise an error. The serialization process saves the type of the variable and the value of the OuterXml property, which can then later be used to instantiate a matching
System.Xml.XmlDocument when deserializing.


I got this exception when we want to receive a response type as System.Xml.XmlDocument from a C# class. or if we have System.Xml.XmlDocument object declaration at class level.

 Use Default Constructor property causes an instance of the object to be constructed when the orchestration instantiates. If this property is set to False, the variable will need to be instantiated in an Expression shape through the new keyword. Try this, otherwise use below option.
                                      OR

Mark the member as NonSerializable. BizTalk will not attempt to serialize the object and you shouldn't see this error
                                     OR
The solution is very simple: if you're using, in any of your orchestrations, assemblies that have a XmlDocument type field as a response. Then make that class and members are static (No instance, no persistence, no serialization).


Possible error is:
Type 'System.Xml.XmlDocument' in Assembly 'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.