Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

"Unable to load plug-in assembly" error Dynamics 365 On-Premise when debug workflow activity

(0) ShareShare
ReportReport
Posted on by 422

Hi Guys,

I am getting an error when trying to profile a workflow. My custom workflow is using the .NET Framework 4.6.2.

I created the workflow in CRM and added the step. In the plugin registration tool, I try and profile the workflow and get this error:

   Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unable to load plug-in assembly.
Detail: 
  513961ef-328a-4b27-8230-39e692dd7412
  -2147204719
  
    
      ApiExceptionSourceKey
      Plugin/Microsoft.Crm.ObjectModel.PluginAssemblyService
    
    
      ApiOriginalExceptionKey
      Microsoft.Crm.CrmException: Unable to load plug-in assembly. ---> Microsoft.Crm.CrmException: Unable to load plug-in assembly.
   at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.LoadCrmPluginAssemblyMetadata(IBusinessEntity pluginAssembly, ExecutionContext context, Boolean loadAllMetadata)
   at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.RetrieveAssemblyMetadata(IBusinessEntity pluginAssembly, ExecutionContext context, Boolean retrieveFromExisting, Boolean forSystemAssembly)
   at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.ValidateOperation(String operationName, IBusinessEntity entity, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.SdkEntityServiceBase.CreateInternal(IBusinessEntity entity, ExecutionContext context, Boolean verifyAction)
   --- 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.b__0()
    
    
      ApiStepKey
      3ecabb1b-ea3e-db11-86a7-000a3a5473e8
    
    
      ApiDepthKey
      1
    
    
      ApiActivityIdKey
      513961ef-328a-4b27-8230-39e692dd7412
    
    
      ApiPluginSolutionNameKey
      System
    
    
      ApiStepSolutionNameKey
      System
    
  
  
  Unable to load plug-in assembly.
  2021-11-25T13:14:13.4504656Z
  false
  
  
    513961ef-328a-4b27-8230-39e692dd7412
    -2147204719
    
    
    Unable to load plug-in assembly.
    2021-11-25T13:14:13.4504656Z
    false
    
    
    
    
  
  
  


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 PluginProfiler.Library.ProfilerManagementUtility.CreateWorkflowAssembliesAndTypes(CrmServiceClient service, ActivityAssemblyCompilerConfiguration configuration, Dictionary`2 types, OptionSetValue isolationMode, DateTime lastModified, IEnumerable`1 mappedAssemblies)
   at PluginProfiler.Library.ProfilerManagementUtility.InstrumentWorkflowSteps(CrmServiceClient service, Guid workflowId, String keyFileName, CustomActivityStep[] workflowSteps)
   at PluginProfiler.Library.ProfilerManagementUtility.EnableWorkflow(CrmServiceClient service, String overrideKeyFileName, Guid workflowId, Boolean persistToEntity, String persistenceSessionKey, Boolean includeSecureInformation, Boolean isContextReplay, CustomActivityStep[] workflowSteps)
   at Microsoft.Crm.Tools.PluginRegistration.CommonControls.ProfilerSettingsViewModel.btnOk_Click()
   

Any ideas?

Thanks,

Stone

  • Mohsin Ali Profile Picture
    Mohsin Ali 3,614 on at
    RE: "Unable to load plug-in assembly" error Dynamics 365 On-Premise when debug workflow activity

    Make sure you set the 'Copy to Local' property of 'microsoft.xrm.sdk' and 'microsoft.xrm.client' as True in VS prior to deploy.

    Additionally, if you want to debug only then I would recommend to use tracing service inside plugin/workflow activity to track the execution of the plugin/workflow.

  • Suggested answer
    Pradeep Rai Profile Picture
    Pradeep Rai 5,482 Super User 2025 Season 1 on at
    RE: "Unable to load plug-in assembly" error Dynamics 365 On-Premise when debug workflow activity

    Hi,

    I would suggest to check the libraries used in plugin.

    And try to remove all the none required assembly reference.

    And try by deleting SNK file and create new one.

  • Suggested answer
    Vipin J Profile Picture
    Vipin J 1,583 on at
    RE: "Unable to load plug-in assembly" error Dynamics 365 On-Premise when debug workflow activity

    Make sure you are using correct version of SDK assembly. Refer below links to know how to correct them

    https://vjcity.blogspot.com/2021/07/could-not-load-file-or-assembly.html

    https://vjcity.blogspot.com/2021/07/assembly-microsoftcrmsdkproxy-with.html

    https://vjcity.blogspot.com/2021/10/unable-to-login-to-dynamics.html

  • Stone Huang Profile Picture
    Stone Huang 422 on at
    RE: "Unable to load plug-in assembly" error Dynamics 365 On-Premise when debug workflow activity

    I tried, but results were the same. I don't know why.

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: "Unable to load plug-in assembly" error Dynamics 365 On-Premise when debug workflow activity

    Hi,

    Have you tried unregistering the Plugin profiler and install again?

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Stone Huang Profile Picture
    Stone Huang 422 on at
    RE: "Unable to load plug-in assembly" error Dynamics 365 On-Premise when debug workflow activity

    Hi Kumar,

    No, I don't use ILMerge. 

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: "Unable to load plug-in assembly" error Dynamics 365 On-Premise when debug workflow activity

    Hi,

    Are you using ILMerge to merge external dll in your plugin assembly?

    If answer to above question is yes then check if Copy to local property is set to true for below dll -

    microsoft.xrm.sdk

    microsoft.xrm.client

    make sure you check all OOB Microsoft DLL and set the copy to local property to false.

    Please mark my answer verified if this is helpful!

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,387 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans