A few weeks ago, while improving an existing solution to fulfill the new business requirements, I encountered the following error while trying to validate or test a BizTalk map:
“Exception Caught: The map contains a reference to a schema node that is not valid. Perhaps the schema has changed. Try reloading the map in the BizTalk Mapper. The XSD XPath of the node is: /*[local-name()='<Schema>’]/*[local-name()=’MyRootNode’]/*[local-name()=’MyRecord]/*[local-name()=’MyElement’]”
To contextualize the problem, the BizTalk Visual Studio solution I was working on was composed of several projects, but for the purpose of this error, let’s say that we had two projects:
- Schemas Project: containing all the schemas used by the BizTalk Solution;
- Map Project: containing all the maps used by the BizTalk Solution;
I made the necessary changes to the source schema, and they were automatically reflected in the map I was working on without needing to rebuild the Schema Project. And when I try to test the map after making all the necessary changes to it, I get the error above.
Which was a little awkward at the time because I had indeed changed the contract of the source schema, but it was reflected in the map I was working on. Everything seemed fine, I even tried to close and open the map again, but that did not solve the problem
📝 One-Minute Brief
This post explains how to fix a BizTalk Mapper validation error that occurs after schema changes, showing that the issue is caused by outdated schema assemblies and can be resolved by rebuilding the schema or the entire solution.
Causes
Again, the reason for this error is awkward: the schema changes were reflected on the map, even if it was a different solution, without rebuilding the Schema Solution. However, the cause of this error is that it refers to an invalid or incorrect version of the Schema assembly.
Solution
The solution to the “The map contains a reference to a schema node that is not valid” issue is simple: you just need to rebuild the entire solution, or rebuild the schema project, before you try to validate or test the maps.
After the Schema project solution is rebuilt, the problem will disappear, and you will be able to validate or test the map.
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.
1 thought on “BizTalk Mapper: The map contains a reference to a schema node that is not valid. Perhaps the schema has changed. Try reloading the map in the BizTalk Mapper.”