locked
System.InvalidCastException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #8F426FB1 RRS feed

  • Question

  • Hello All,
              I have face some unknown error.It seems like it is some casting error but don't know what exactly it is and how to resolve the issue.This error has occure when I have migrated CRM4 plugin code to CRM2011.

    Error description is as follow,

    nhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.InvalidCastException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #8F426FB1Detail: 
      <ErrorCode>-2147220891</ErrorCode>
        <KeyValuePairOfstringanyType>
          <d2p1:key>CallStack</d2p1:key>
          <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">   at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)
       at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext context, Boolean returnResponse)
       at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
       at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)</d2p1:value>
        </KeyValuePairOfstringanyType>
        <KeyValuePairOfstringanyType>
          <d2p1:key>OperationStatus</d2p1:key>
          <d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">0</d2p1:value>
        </KeyValuePairOfstringanyType>
      </ErrorDetails>
      <Message>System.InvalidCastException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #8F426FB1</Message>
      <Timestamp>2013-09-02T14:04:52.2336505Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText>

    [ServicePlanEntityPlugin: APD.ServicePlanEntityPlugin]
    [c6eee864-ae04-e311-8723-0050569e40a9: APD.ServicePlanEntityPlugin: Create of apd_ibg_serviceplan]


    </TraceText>
    </OrganizationServiceFault>
    Thursday, September 5, 2013 4:34 AM

Answers

  • Hello Diwakar,

                          I have also faced this issue many times and now quite familiar with this.The main thing behind this issue is ,it generally occurs when we are migrating CRM4 plugin code to CRM2011 or higher version.Because the typing cast in CRM4 and CRM2011 are somewhat different.

    This is mainly because there is could have be some casting issue with the fields.Mainy following types of fields casting  raises this issue.

    1)Money

    2)Date

    3)GUID

    I would suggest you to cast this types of fileds in proper manner.Refer the following example.....

    1)If the code is  like _entity.Attributes.Add("moneyfieldname",moneyfieldvaluename.value) the rewrite it as 

    _entity["moneyfieldname"]=moneyfieldvaluename;

    2)if the code is like _entity.Attributes.Add("DateFiledName",DateFieldName) the rewrite it as 

    _entity["DateFiledName"]=DateFieldName;

    -----------------------------------------------------------------------------

    If this post is helpfull to you then please mark this as  a answer.

    • Marked as answer by diwakarj Thursday, September 5, 2013 10:47 AM
    Thursday, September 5, 2013 4:52 AM

All replies

  • Thursday, September 5, 2013 4:45 AM
  • Hello Diwakar,

                          I have also faced this issue many times and now quite familiar with this.The main thing behind this issue is ,it generally occurs when we are migrating CRM4 plugin code to CRM2011 or higher version.Because the typing cast in CRM4 and CRM2011 are somewhat different.

    This is mainly because there is could have be some casting issue with the fields.Mainy following types of fields casting  raises this issue.

    1)Money

    2)Date

    3)GUID

    I would suggest you to cast this types of fileds in proper manner.Refer the following example.....

    1)If the code is  like _entity.Attributes.Add("moneyfieldname",moneyfieldvaluename.value) the rewrite it as 

    _entity["moneyfieldname"]=moneyfieldvaluename;

    2)if the code is like _entity.Attributes.Add("DateFiledName",DateFieldName) the rewrite it as 

    _entity["DateFiledName"]=DateFieldName;

    -----------------------------------------------------------------------------

    If this post is helpfull to you then please mark this as  a answer.

    • Marked as answer by diwakarj Thursday, September 5, 2013 10:47 AM
    Thursday, September 5, 2013 4:52 AM