Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

"Unable to load plug-in assembly" when registering plugins in CRM online using Plug In Registration Tool

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am using dynamics 365 online for development and trying to integrate dynamics 365 web api in my existing C# project which uses the organizationService SOAP endpoints.

Before making any changes to the code, i was able to successfully register the plugins.

However, i took help from Web API samples provided by microsoft at https://msdn.microsoft.com/en-us/library/mt742424.aspx and tried to integrate into my existing plugins.

Now, "updating" the plugins through Plugin Registration Tool (SDK 365) gives me 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]]: Unable to load plug-in assembly.
Detail: <OrganizationServiceFault xmlns="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance">
<ActivityId>5a544e50-bf0c-4915-91c2-dad14b293e11</ActivityId>
<ErrorCode>-2147204719</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Unable to load plug-in assembly.</Message>
<Timestamp>2017-06-19T10:35:24.7599515Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>5a544e50-bf0c-4915-91c2-dad14b293e11</ActivityId>
<ErrorCode>-2147204719</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Unable to load plug-in assembly.</Message>
<Timestamp>2017-06-19T10:35:24.7599515Z</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()

The tool's log mentions :

Preparing Registration 
ERROR: Occurred while checking whether the assembly exists


 
I tried to find the resolution for this error in the community posts, and did not get a clear workaround.

One answer mentions to check that the assembly versions are in fact correct and belong to dynamics 365 SDK.

I tried that too, but still got the same error.

My original package.config :

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Csv" version="1.0.10.0" targetFramework="net45" />
  <package id="ilmerge" version="2.14.1208" targetFramework="net45" />
  <package id="MSBuild.ILMerge.Task" version="1.0.2" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
</packages>


After integrating web Api code, package.config :

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Csv" version="1.0.10.0" targetFramework="net45" />
  <package id="ilmerge" version="2.14.1208" targetFramework="net45" />
  <package id="Microsoft.CrmSdk.WebApi.Samples.HelperCode" version="8.1.0.8" targetFramework="net45" />
  <package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.1" targetFramework="net45" />
  <package id="MSBuild.ILMerge.Task" version="1.0.2" targetFramework="net45" />
  <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
  <package id="RestSharpSigned" version="105.2.3" targetFramework="net45" requireReinstallation="True" />
</packages>


After trying to updgrade the assembly to match 365 :

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Csv" version="1.0.10.0" targetFramework="net452" />
  <package id="ilmerge" version="2.14.1208" targetFramework="net452" />
  <package id="Microsoft.CrmSdk.CoreAssemblies" version="8.2.0.2" targetFramework="net452" />
  <package id="Microsoft.CrmSdk.WebApi.Samples.HelperCode" version="8.1.0.8" targetFramework="net452" />
  <package id="Microsoft.IdentityModel" version="6.1.7600.16394" targetFramework="net452" />
  <package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.1" targetFramework="net452" />
  <package id="MSBuild.ILMerge.Task" version="1.0.2" targetFramework="net452" />
  <package id="Newtonsoft.Json" version="8.0.3" targetFramework="net452" />
  <package id="RestSharpSigned" version="105.2.3" targetFramework="net452" />
</packages>


But i still get the same error.

Note : I am registering the assembly in Database and using ILMerge to merge the assemblies into single assembly.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: "Unable to load plug-in assembly" when registering plugins in CRM online using Plug In Registration Tool

    Perhaps a bit late, but here's some information for anyone with a similar issue.

    When using ILMerge you don't need to merge the crm assemblies as they are provided, I don't merge Microsoft.IdentityModel.dll either so perhaps any from Microsoft don't need to be added.

    Also, Active Directory can't be used in a sand-boxed environment. This is what gave me the error you received. 

    I found this resource useful when creating an alternative: http://www.zacrmguy.com/alternative-to-azure-authentication-with-adal-in-dynamics-crm-online-sandbox/

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: "Unable to load plug-in assembly" when registering plugins in CRM online using Plug In Registration Tool

    I am adding these assemblies :

    MyPlugins.dll
    Microsoft.Xrm.Sdk.Deployment.dll
    Csv.dll
    Microsoft.Crm.Sdk.Proxy.dll
    Microsoft.IdentityModel.Clients.ActiveDirectory.dll
    Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll
    Microsoft.IdentityModel.dll
    Microsoft.Xrm.Sdk.dll
    Newtonsoft.Json.dll
    RestSharp.dll
    


  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: "Unable to load plug-in assembly" when registering plugins in CRM online using Plug In Registration Tool

    Which assemblies are you adding to ilmerge from the list above?

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans