Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

Export Solution Error - Fails

I am trying to export a PowerApps solution (for source control purposes) but the Export Solution operation fails with the error below.

I Published all customizations prior to running the export. I am using the 'Unmanaged' package type.

Is there a workaround for this bug?


Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An unexpected error occurred.Detail:
<OrganizationServiceFault xmlns:i="" xmlns="">
  <ErrorDetails xmlns:d2p1="">
      <d2p1:value xmlns:d4p1="" i:type="d4p1:string">Plugin/Microsoft.Crm.WebServices.ExportXmlService</d2p1:value>
      <d2p1:value xmlns:d4p1="" i:type="d4p1:string">Microsoft.Crm.CrmException: An unexpected error occurred. ---> System.InvalidOperationException: The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type.
   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)
   at Microsoft.Crm.Tools.ImportExportPublish.ExportHandler.Export(XmlDocument XDoc)
   at Microsoft.Crm.Tools.ImportExportPublish.RootExportHandler.RunExport()
   at Microsoft.Crm.WebServices.ExportXmlService.ExportSolutionWithTargetVersion(String solutionName, Boolean managed, String targetVersion, Boolean exportAutoNumberingSettings, Boolean exportCalendarSettings, Boolean exportCustomizationSettings, Boolean exportEmailTrackingSettings, Boolean exportGeneralSettings, Boolean exportMarketingSettings, Boolean exportOutlookSynchronizationSettings, Boolean exportRelationshipRoles, Boolean exportIsvConfig, Boolean exportSales, Boolean exportExternalApplications, ExecutionContext context)
   --- End of inner exception stack trace ---
   at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.Pipeline.<>c__DisplayClass2_1.<Execute>b__0()</d2p1:value>
      <d2p1:value xmlns:d4p1="" i:type="d4p1:string">681f0f11-8e01-40a1-8d84-424242bb392c</d2p1:value>
      <d2p1:value xmlns:d4p1="" i:type="d4p1:string">1</d2p1:value>
      <d2p1:value xmlns:d4p1="" i:type="d4p1:string">e866e2dc-3094-404c-8d51-acd439f41c6b</d2p1:value>
      <d2p1:value xmlns:d4p1="" i:type="d4p1:string">System</d2p1:value>
      <d2p1:value xmlns:d4p1="" i:type="d4p1:string">System</d2p1:value>
  <Message>An unexpected error occurred.</Message>
  <ExceptionSource i:nil="true" />
  <InnerFault i:nil="true" />
  <OriginalException i:nil="true" />
  <TraceText i:nil="true" />


Community Support
Community Support

Hi @BrianSlalomMS,


Did you follow the steps in below documentation?


About the Unmanaged package type, would you please take a screenshot about it?




Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Can't follow the instructions at the link you sent me becasue the 'Export' command is not available in that menu on my PowerApps portal. See screen shot. Could this be becasue my app is a model-driven app instead of a canvas app?


I have only found access to the export command for the app from the Dynamics 365 portal.

Screen shot of that page, showing the 'Export Solution' command I am using and showing the unmanaged package type, is also attached.


Are you still having this issue?

Yes. This is still a problem for us. 

We can't export our solution. 

Is this resolved now? I am also facing the same issue while exporting an unmanaged solution.

Need a bit of help. Any suggestions will be helpful.

Sumbharti,  are you trying to export a solution or just an app?

New Member

I have just encountered a similar error.  The error message call stack mentions SiteMapExportHandler, so I created a new Solution, and under Client Extensions I added to it all the existing unmanaged Site Maps (without the 'Required Components').  In my case there were only three.  I then ran an export of my solution, and it produced the same error.  I narrowed this to one and proved that the other two were ok.  I expected to need to delete and recreate or re-import it, but in my case it turned out to be an old and redundant site map that could simply be deleted, and then the original solution exported without difficulty. 

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,702)