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)

Registering a custom workflow activity using plug-in registration tool

(0) ShareShare
ReportReport
Posted on by

I have created a custom workflow activity which i want to use along with my plugins. I am successfully able to register both the plugins and activity when i create each of them under separate projects and then register the assemblies one by one on my organization in the database.  

Now, i want to merge both my plugins and the custom workflow activity into 1 assembly and register them again in the database. For this i included the custom activity also in the existing project of the plugins.

I am using the plugin registration tool, it registers my plugins successfully but is unable to register the activity. Here is the error i am getting this error : "Exception retrieving custom activity info - Exception has been thrown by the target of an invocation"

Here is the full log :

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Exception retrieving custom activity info - Exception has been thrown by the target of an invocation.
Detail: <OrganizationServiceFault xmlns="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance">
  <ActivityId>ef4dcf8f-06fe-4aac-aa6b-d38b87879353</ActivityId>
  <ErrorCode>-2147200995</ErrorCode>
  <ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
  <Message>Exception retrieving custom activity info - Exception has been thrown by the target of an invocation.</Message>
  <Timestamp>2017-10-03T13:10:28.9635097Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault>
    <ActivityId>ef4dcf8f-06fe-4aac-aa6b-d38b87879353</ActivityId>
    <ErrorCode>-2147200995</ErrorCode>
    <ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
    <Message>Exception retrieving custom activity info - Exception has been thrown by the target of an invocation.</Message>
    <Timestamp>2017-10-03T13:10:28.9635097Z</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.RegisterPlugin(CrmOrganization org, CrmPlugin plugin)
   at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.btnregisterClick()

Using ILMerge, i am merging the following dlls with my plugins + custom activity:

Microsoft.Xrm.Sdk.Deployment.dll
Newtonsoft.Json.dll

I am not merging these assemblies :

Microsoft.Xrm.Sdk.Workflow

Microsoft.Xrm.Sdk

Microsoft.Crm.Sdk.Proxy

Is there something more i need to do to register the custom workflow activity?

Edit 1 : 

Earlier i was merging the crm assembly Microsoft.Xrm.Sdk.Deployment.dll. Now after removing it from the merged dll, i am able to register the assembly in database in non-sabdbox mode but not in SandBox mode. I would want to register the assembly in sandbox mode also, since i will have to deploy my solution on CRM online also.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Daniel Wikell Profile Picture
    2,360 on at

    Hi

    You should not merge any Microsoft.Xrm/Crm-assemblies when you are doing the ILMerge. Remove Microsoft.Xrm.Sdk.Deployment.dll from your merge-dll-list and try again.

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Why are you merging Microsoft.Xrm.Sdk.Deployment?

    It seems like your are using On-Prem. Sometimes registering assemblies that use ILMerge with packaged assemblies has some issues, which I am not completely sure is you issue here.

    - If you don't need the Deployment and Json assemblies to be part of your registered workflow, possibly see if you can install them in the GAC.

    Hope this helps.

  • Community Member Profile Picture
    on at

    Thanks Daniel. I am able to register assembly in database in non-sandbox mode, but not in sandbox mode and get the same error. Do you have some pointers on why this may happen.

  • Community Member Profile Picture
    on at

    Eric, I have removed Microsoft.Xrm.Sdk.Deployment from assembly and it works with On-prem registration in database in non-sandbox mode, but not in sandbox mode. I would also like to register in sandbox so that this assembly works on CRM online which allows registration in sandbox mode only.

    Also GAC is not the option with me as i would like to work on CRM online also.

  • Daniel Wikell Profile Picture
    2,360 on at

    What is the error you receive when trying to register it in sandbox? Usually it gives you a specific error on code that perhaps violates the security restrictions of sandbox mode (which is a lot higher than database mode)

  • Community Member Profile Picture
    on at

    The same error as mentioned in my original question. i.e. Exception retrieving custom activity info - Exception has been thrown by the target of an invocation.

    By the error message, it's not clear specifically what the error is.

    The log of the plugin registration tool is :

    Preparing Registration

    ERROR: Occurred while checking whether the assembly exists

  • Community Member Profile Picture
    on at

    Have you been able to register your custom workflow assembly? I am trying to register a custom workflow activity assembly, in an online, 8.2 environment. I am receiving the same error.

    Exception retrieving custom activity info - Exception has been thrown by the target of an invocation.

  • Community Member Profile Picture
    on at

    Hi, I am having a same error while registering a customworkflow with InArguments  using Dynamics 365 online.

    Please see the error below and let me know if nay one have solved similar issue.

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Exception retrieving custom activity info - Exception has been thrown by the target of an invocation.
    Detail: <OrganizationServiceFault xmlns="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance">
    <ActivityId>5fc61d7a-963f-43ba-b1aa-7b620f162609</ActivityId>
    <ErrorCode>-2147200995</ErrorCode>
    <ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
    <Message>Exception retrieving custom activity info - Exception has been thrown by the target of an invocation.</Message>
    <Timestamp>2017-11-13T13:13:32.4992966Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault>
    <ActivityId>5fc61d7a-963f-43ba-b1aa-7b620f162609</ActivityId>
    <ErrorCode>-2147200995</ErrorCode>
    <ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
    <Message>Exception retrieving custom activity info - Exception has been thrown by the target of an invocation.</Message>
    <Timestamp>2017-11-13T13:13:32.4992966Z</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.RegisterPlugin(CrmOrganization org, CrmPlugin plugin)
    at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.btnregisterClick()

  • Community Member Profile Picture
    on at

    What I experienced is that I am having difficulty when using Visual Studio 2015, using CRM Developer Extensions, and plug-in registration. This issue only occurs when I target Dynamics 365 online, version 8.2.1.  I am, however, successful when I targeted the latest, version 9.0 of Dynamics 365.

    Since my ultimate goal is to target version 8.2.1, I decided to fallback to Visual Studio 2012, using the CRM Developer Toolkit. For some reason this worked.

  • Community Member Profile Picture
    on at

    Hi, I had the same trouble but I've just resolve it. Trouble was in NuGet package created by CRM Developer Extension. It automatically installed latest version 9.0.0.5, but my aplication has version 8.2.2, so I changed version to lower, rebuild project and everythink goes ok.

    Hope this help!

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