locked
crm 2011 online: Issue when debugging custom workflow activity RRS feed

  • Question

  • Hi,

    I have created a custom workflow activity for CRM 2011 online.

    The workflow fails, so I am trying to debug it.I have installed profiler, attached visual studio to plugin registration tool.

    But I get this error when I try to 'Start Execution' from Plugin reg tool.

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Could not load file or assembly 'Microsoft.Xrm.Sdk.Workflow, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
    Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <ErrorCode>-2147220970</ErrorCode>
      <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
        <KeyValuePairOfstringanyType>
          <a:key>CallStack</a:key>
          <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">   at System.Activities.WorkflowApplication.Invoke(Activity activity, IDictionary`2 inputs, WorkflowInstanceExtensionManager extensions, TimeSpan timeout)
       at System.Activities.WorkflowInvoker.Invoke(Activity workflow, IDictionary`2 inputs, TimeSpan timeout, WorkflowInstanceExtensionManager extensions)
       at System.Activities.WorkflowInvoker.Invoke(IDictionary`2 inputs)
       at PluginProfiler.Library.WorkflowAppDomainProxy.ExecuteCore(Stopwatch watch, ProfilerExecutionReport report, Object instance, Object executionParameter)
       at PluginProfiler.Library.AppDomainProxy.Execute(ProfilerExecutionConfiguration configuration, ProfilerExecutionReport report)</a:value>
        </KeyValuePairOfstringanyType>
      </ErrorDetails>
      <Message>Could not load file or assembly 'Microsoft.Xrm.Sdk.Workflow, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</Message>
      <Timestamp>2013-08-27T13:04:59.2179304Z</Timestamp>
      <InnerFault i:nil="true" />
      <TraceText i:nil="true" />
    </OrganizationServiceFault>

    I am not sure what the issue, I have been stuck with this.

    It will be appreciated if you can assist me in this issue please.

    Regards,

    Wesley

    Tuesday, August 27, 2013 1:17 PM

All replies

  • Hi Wesley, 

    It seems like the dll Microsoft.Xrm.sdk.Workflow can't be loaded or found. have you installed the latest SDK ? , if you have, maybe the reference is broken, so you can try to remove and add the reference to the specified dll and rebuild.

    hope this helps

    best regards.

    Tuesday, August 27, 2013 2:17 PM
  • Another possibility is if your assembly references any external assembly, other than the Crm and Workflow ones. This would cause the same error. It's not possible to call external assemblies in Crm Online

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Tuesday, August 27, 2013 7:28 PM
    Moderator
  • Hi Andersen

    I tried adding the dll again from latest SDK. But I get the same error again.

    Kindly help me.

    Regards,

    Wesley

    Wednesday, August 28, 2013 3:48 AM
  • Hi David

    I am not referencing any external assembly. Not sure why this issue is there.

    Annoyed from 2 days.7

    regards,

    Wesley

    

    Wednesday, August 28, 2013 3:51 AM
  • Hi Wesley, 

    I've read this blog post where the same problem is solved by placing the needed dll's in the bin folder of the ISV, Check it out it might be helpful.

    http://nishantrana.wordpress.com/2011/01/20/could-not-load-file-or-assembly-microsoft-crm-version5-0-0-0-cultureneutral-publickeytoken31bf3856ad364e35-or-one-of-its-dependencies-the-system-cannot-find-the-file-specified-or-deploying/

    Regards, 

    Andersen

    Wednesday, August 28, 2013 6:00 AM
  • I suggest using the ITracingService to trace all parts of the custom workflow. Throw an InvalidPluginExecutionException at the end of the plugin code and then register the updated assembly with CRM.

    Triggering the workflow activity will result in a Failed System Job which you can then open up and view the error.

    Wednesday, August 28, 2013 9:05 AM
  • I'm getting an identical error. Did you ever find resolution?
    Monday, June 16, 2014 2:25 PM