If you are developing orchestrations in BizTalk Server, you’ve likely run into one of those “ghost” errors—the ones that stop your build dead in its tracks but don’t seem to have a logical cause. One of the most common is:
“‘System.String’ must be Xml serializable to be a message part type — check event log for more information“
You check the Event Log, and there is nothing there. You know System.String is serializable (it’s a base .NET type!), and you’ve used it in dozens of other projects. So, why now?
📝 One-Minute Brief
Developers may encounter a BizTalk build error stating that System.String must be XML serializable to be a message part type. Despite the error’s suggestion, there is usually no helpful information in the Event Log. This issue is typically a glitch in the Visual Studio environment; the most effective solution is simply restarting Visual Studio.
Cause
Despite what the error says, there’s no further information in the event log as it suggests.
I’ve certainly used System.String parts before, and it worked just fine. Why the error now?
Despite the misleading error message, this is rarely an issue with your code or your schema. Instead, it is usually a metadata caching issue within the Visual Studio Orchestration Designer and the XLANG compiler.
When you build a BizTalk project, the compiler validates all message parts. Occasionally, the compiler’s internal type cache becomes “stale” or disconnected from the .NET Framework’s base assemblies. It loses the “knowledge” that System.String is XML serializable, resulting in a build failure.
Solution
In 99% of cases, you don’t need to change a single line of code. Follow these steps in order:
- The Simple Restart (The “Sandro” Method)
- After a couple of hours of chasing my tail around this, I did the only sensible thing to do – I restarted Visual Studio.
- Restarting Visual Studio will solve it every time. Great!
- The Deep Clean (If a restart fails)
- If you restart and the error persists, the corrupted metadata might be sitting in your project’s temporary folders.
- Close Visual Studio.
- Navigate to your project folder and delete the
binandobjdirectories. - Reopen Visual Studio and perform a Rebuild All.
- If you restart and the error persists, the corrupted metadata might be sitting in your project’s temporary folders.
Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son.