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)

Start Profiling Workflow

(0) ShareShare
ReportReport
Posted on by

Anyone know what to do with this error when attempting to start profiling a custom workflow?

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=]]: Unable to load plug-in assembly.
Detail: <OrganizationServiceFault xmlns="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance">
<ActivityId>34bce4af-c0b3-4bf6-b57c-425cefa67f55</ActivityId>
<ErrorCode>-2147204719</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<a:key>ApiExceptionSourceKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">Plugin/Microsoft.Crm.ObjectModel.PluginAssemblyService</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiOriginalExceptionKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">Microsoft.Crm.CrmException: Unable to load plug-in assembly. ---&gt; 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.&lt;&gt;c__DisplayClass1_1.&lt;Execute&gt;b__0()</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiStepKey</a:key>
<a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../Serialization">3ecabb1b-ea3e-db11-86a7-000a3a5473e8</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiDepthKey</a:key>
<a:value i:type="b:int" xmlns:b="www.w3.org/.../XMLSchema">1</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiActivityIdKey</a:key>
<a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../Serialization">34bce4af-c0b3-4bf6-b57c-425cefa67f55</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiPluginSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">System</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiStepSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">System</a:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>Unable to load plug-in assembly.</Message>
<Timestamp>2018-05-03T20:43:01.2114882Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>34bce4af-c0b3-4bf6-b57c-425cefa67f55</ActivityId>
<ErrorCode>-2147204719</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Unable to load plug-in assembly.</Message>
<Timestamp>2018-05-03T20:43:01.2114882Z</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 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()

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Shahbaaz Ansari Profile Picture
    6,211 on at

    Please check below link,

    community.dynamics.com/.../145463

    community.dynamics.com/.../240921

    Thanks,

    Shahbaaz

  • Suggested answer
    Justinjose Profile Picture
    2,707 on at

    Hi mroot,

    Can you please make sure the version of plugin registration tool and CRM version matches. I have face same issue when I use plugin registration version 9.0 to Profile CRM 8,2. To fix the issue I have to uninstalled Profiler and used 8.2 to install profile and start profile workflow.

    Thanks

    Justin Jose

  • mroot Profile Picture
    on at

    Thanks, Justin.  The versions are the same.

  • mroot Profile Picture
    on at

    Justin- what version of .NET were you using to build your workflow in Visual Studio?

  • Justinjose Profile Picture
    2,707 on at

    Hi mroot,

    I was working on CRM 8.2 and custom workflow .NET version is 4.5.2. May I know your CRM version.

    Thanks

    Justin Jose

  • mroot Profile Picture
    on at

    I was using Dynamics v9 with plugin registration v9. Building custom workflow with .net 4.6.2 and wasn't able to register my workflow in plugin registration at all.   Went down and built custom workflow with .net 4.5.2 and was able to register my workflow but not able to profile it.

  • Justinjose Profile Picture
    2,707 on at

    Hi mroot,

    are you Using IL Merge to add external assemblies?

    Thanks

    Justin Jose

  • mroot Profile Picture
    on at

    I am not.

    Thanks,

    Matt

  • Suggested answer
    Justinjose Profile Picture
    2,707 on at

    Hi mroot,

    Can you please try following suggestions.

    1.  Can you try registering custom workflow in a different v9 environment to make sure issue is not with environment  
    2.  Create simple custom workflow ( see below code) only for test purpose to make sure issue is not with workflow. Please do everything from scratch  like
      • Uninstall Profiler and Re install Profiler
      • Build custom workflow with .net 4.6.2
      • use plugin registration tool version 9
     public class WorkflowClass1 : CodeActivity
        {
            [Input("Name")]
            public InArgument<string> Name { get; set; }
            protected override void Execute(CodeActivityContext executionContext)
            {
                ITracingService tracer = executionContext.GetExtension<ITracingService>();
                IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();
                IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();
                IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
    
                try
                {
                    Entity entity = (Entity)context.InputParameters["Target"];
                    var name = Name.Get<string>(executionContext);
    
                    //TODO: Do stuff
                }
                catch (Exception e)
                {
                    throw new InvalidPluginExecutionException(e.Message);
                }
            }
        }


    Hope this help you

    Thanks

    Justin Jose

       

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