web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Unhandled Exception When Exporting Managed Solutions

(1) ShareShare
ReportReport
Posted on by 205

I have a solution that contains several entities. When I export it as an UNMANAGED solution it completes successfully

when i try to export it as a MANAGED solution, i get the error show below. It does not give me any hints as to the cause (as far as I can tell)

there are no messages in the TRACE log

I think i have it narrowed to the Incident Entity

I created a new entity for just the Incident Entity.

When I add just the fields, all of them, i get a warning that the new_EndDate field is missing. It is not, it was selected as part of all the fields.

However, if i tell it to include the field and then try to export, I get the same error as shown below.

If I ignore the warning, and do NOT include the field the solution is created.

Does anyone have an explanation for this? is there something that i should be looking for?

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf38abcde64e35]]: An unexpected error occurred.Detail:

<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">

  <ActivityId>80a8c570-c9fc-4a5f-9966-e518930110d8</ActivityId>

  <ErrorCode>-2147220970</ErrorCode>

  <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic">

    <KeyValuePairOfstringanyType>

      <d2p1:key>ApiExceptionSourceKey</d2p1:key>

      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Plugin/Microsoft.Crm.WebServices.ExportXmlService</d2p1:value>

    </KeyValuePairOfstringanyType>

    <KeyValuePairOfstringanyType>

      <d2p1:key>ApiOriginalExceptionKey</d2p1:key>

      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">Microsoft.Crm.CrmException: An unexpected error occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.

   at System.Xml.XmlNode.AppendChild(XmlNode newChild)

   at System.Xml.XmlNode.ReplaceChild(XmlNode newChild, XmlNode oldChild)

   at Microsoft.Crm.Tools.ImportExportPublish.FormXmlHandler.CreateFormNode(XmlElement containerElement, String formType, BusinessEntity formEntity, String formNodeInitialXml, Boolean isManaged, SolutionAwareLocalizedLabelService localizedLabelService, Boolean isOnlyFormStateModified)

   at Microsoft.Crm.Tools.ImportExportPublish.FormXmlHandler.CreateFormsInnerXmlManaged(XmlElement formXmlNode, SolutionAwareLocalizedLabelService localizedLabelService)

   at Microsoft.Crm.Tools.ImportExportPublish.FormXmlHandler.ExportItem(XmlDocument exportDocument)

   at Microsoft.Crm.Tools.ImportExportPublish.ExportHandler.Export(XmlDocument XDoc)

   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>

    </KeyValuePairOfstringanyType>

    <KeyValuePairOfstringanyType>

      <d2p1:key>ApiStepKey</d2p1:key>

      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">681f0f11-8e01-40a1-8d84-424242bb392c</d2p1:value>

    </KeyValuePairOfstringanyType>

    <KeyValuePairOfstringanyType>

      <d2p1:key>ApiDepthKey</d2p1:key>

      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">1</d2p1:value>

    </KeyValuePairOfstringanyType>

    <KeyValuePairOfstringanyType>

      <d2p1:key>ApiActivityIdKey</d2p1:key>

      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">80a8c570-c9fc-4a5f-9966-e518930110d8</d2p1:value>

    </KeyValuePairOfstringanyType>

    <KeyValuePairOfstringanyType>

      <d2p1:key>ApiPluginSolutionNameKey</d2p1:key>

      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">System</d2p1:value>

    </KeyValuePairOfstringanyType>

    <KeyValuePairOfstringanyType>

      <d2p1:key>ApiStepSolutionNameKey</d2p1:key>

      <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">System</d2p1:value>

    </KeyValuePairOfstringanyType>

  </ErrorDetails>

  <Message>An unexpected error occurred.</Message>

  <Timestamp>2021-08-02T09:14:41.8818373Z</Timestamp>

  <ExceptionRetriable>false</ExceptionRetriable>

  <ExceptionSource i:nil="true" />

  <InnerFault i:nil="true" />

  <OriginalException i:nil="true" />

  <TraceText i:nil="true" />

</OrganizationServiceFault>

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi,

    First, when you work within your solution, be specified when you add the components in the solution, and check the dependencies.

    Secondly, I think when you add the "new_EndDate" field , there is some dependency with this field so you get this error

  • Suggested answer
    Sanchit Profile Picture
    55 on at

    To find out the root cause, you can :

    1: Check if a field with same schema name is present on destination solution.
    2: If yes, Check was it imported as Unmanaged earlier or managed and Check on the publisher name too.

    These kind of issues happen when there is already a field present with same schema in destination environment as umnamaged (May be imported thru an Unmanaged solution earlier) and now same field is changed to managed in new solution version or vice versa.

    Once you know the root cause, you can take action, either remove the field in destination environment or look for some other alternative.

    Solution :

    The easiest is just to have a little different name for your field. After all it's just an schema name. (For example just create a field with schema name as : new_EndingDate)

    You can always change the display name anyway wo whatever you want.

  • moshe raab Profile Picture
    205 on at

    More details....

    If i create a new Solution with just the "incident" entity but without the new_EndDate field and ignore the warning to add the missing field, the unmanaged solution IS created.

    Seems like there is something wrong with that one field. How can i diagnose and repair it?

    Since there is already data in the table i cannot delete and create a new field.

  • moshe raab Profile Picture
    205 on at

    i am not trying to import it anywhere yet, since i can't create it. the error is on the export.

    i thought of creating a new field. but the field is already populated in thousands of rows.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#2
ManoVerse Profile Picture

ManoVerse 60 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 43

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans