This post might be helpful for you in case your solution export is failing with below Error and Stack Trace
Error: System.InvalidOperationException: The specified node cannot be inserted as the valid
child of this node, because the specified node is the wrong type.
Stack Trace:
at System.Xml.XmlNode.AppendChild(XmlNode newChild)
at System.Xml.XmlNode.AppendChild(XmlNode newChild)
at Microsoft.Crm.Tools.ImportExportPublish.SiteMapExportHandler.AppendAppModuleSiteMapXml(XmlDocument exportDocument, Guid siteMapId, String siteMapElementInnerXml)
at Microsoft.Crm.Tools.ImportExportPublish.SiteMapExportHandler.AppendXml(XmlDocument exportDocument, Guid siteMapId, String siteMapElementInnerXml)
at Microsoft.Crm.Tools.ImportExportPublish.SiteMapExportHandler.ExportItem(XmlDocument exportDocument, Guid siteMapId)
at Microsoft.Crm.Tools.ImportExportPublish.AppModuleSiteMapHandler.ExportItem(XmlDocument exportDocument)
What might be the reason?
- Possible reason for this error might be that you are trying to export an empty site map
How can you fix it?
- If you don't need empty site map to be exported as part of your solution and if none of the other component depends on it, then remove it from solution.
- Or you can open the site map, Edit it by adding valid components, save and publish it before exporting the solution again.