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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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

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

I have the same question (0)
  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

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

  • Community Member Profile Picture
    on at

    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
    


  • Community Member Profile Picture
    on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans