Search code examples
dynamics-crmdynamics-crm-onlinedynamics-365

Error registering Plugin Assembly for dynamics 365 crm online


I recently switched computers and had to clone my repo onto a new computer. Everything works fine, I get no build errors or warnings, however, when I go to run SPKL deploy plugins.bat, I get the following error:

Login information is correct, but SPKL not working

I get error Code: -2147220970. Have no idea what that means.. If anyone could guide me on how I could gain back access to spkl as I need it for continuous integration!

Even the plugin registration tool (provided by sdk) shows the following error:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: An unexpected error occurred.
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ActivityId>56924dfd-6d03-4ac1-8e6b-d0341bc81da3</ActivityId>
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>An unexpected error occurred.</Message>
  <Timestamp>2018-09-15T02:11:55.2459404Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>56924dfd-6d03-4ac1-8e6b-d0341bc81da3</ActivityId>
    <ErrorCode>-2147220970</ErrorCode>
    <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>System.FormatException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #ED7531F1</Message>
    <Timestamp>2018-09-15T02:11:55.2459404Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <OriginalException i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>

Server stack trace: 
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RegisterAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly)
   at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.btnregisterClick()

Solution

  • I changed the target framework to 4.5.2 and Microsoft.CrmSdk.CoreAssemblies and and Microsoft.CrmSdk.CoreTools to v8.2.0.2 and v8.2.0.5 respectively and BOOOM, it worked.

    I guess you have to keep watch for the versions that the organization is currently using!