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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

I am not able to register custom work flow

(0) ShareShare
ReportReport
Posted on by 12,119 Moderator

Hi all,

I am using this code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;
using System.Activities;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Sdk.Messages;//RetrieveRequest naemspace
using Microsoft.Crm.Sdk.Messages;
using System.ServiceModel.Description;

namespace Test
{
public class RoundRobinLeadAssignment : CodeActivity
{
protected override void Execute(CodeActivityContext context)
{
ITracingService tracingService = context.GetExtension<ITracingService>();
IWorkflowContext workflowContext = context.GetExtension<IWorkflowContext>();
IOrganizationServiceFactory serviceFactory = context.GetExtension<IOrganizationServiceFactory>();
IOrganizationService service = serviceFactory.CreateOrganizationService(workflowContext.UserId);

//My cystom logic here
}
}
}

Reference below sdk asseblies:

Microsoft.Crm.Sdk.proxy

Microsoft.Xrm.Sdk

Microsoft.Xrm.Sdk.Workflow

use IL merging for reference assemblies.

When I try to register my assembly I have the below error:

3312.Untitled1.png

I tried the link which is provided by  Guido Preite for SDK 6.1.1 But this is not available for me and showed following error

4478.Untitled.png

 

What is wrong? 

 

Thank You

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    CRM 2013 SDK are located here

    https://onedrive.live.com/redir?resid=E4B83260B94D4158!1387&authkey=!ALuzupR9uXK3iII&ithint=folder%2c.exe

    however you can use also the latest SDK plugin registration tool, it should work.

    And the latest SDK for CRM 2013 is 6.1.2 here https://www.microsoft.com/en-us/download/details.aspx?id=40321

  • Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Guido Preite

    I used 6.1.2 that showed me above info.  I have this CRM

    7318.Untitled3.png

    I think previous version is not for me because I have SP1. What is wrong with me. May you please help me more.

    Thank You

  • Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi all

    When I used toll from XRMTollBox. It gives me the below errer:

    Unhandled Exception: System.AggregateException: One or more errors occurred.

      at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)

      at System.Threading.Tasks.Task.Wait()

      at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)

      at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)

      at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)

      at Xrm.Sdk.PluginRegistration.Forms.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)

    Inner Exception: System.ArgumentNullException: Value cannot be null.

    Parameter name: source

      at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)

      at Xrm.Sdk.PluginRegistration.Forms.PluginRegistrationForm.<>c__DisplayClass13_1.<btnRegister_Click>b__0(CrmPlugin currentPlugin)

      at System.Threading.Tasks.Parallel.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30()

      at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)

      at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)

    Any idea What is wrong?

    Thank You

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    You don't need to do IL merging to add these Microsoft assemblies.

    Hope you signed the assemblies (it would show another error message, of course)

    CRM 2013? Are you using the right .net version and SDK?

  • Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Gopalan

    I have this version of CRM as shown below:

    5661.Untitled3.png

    and I dowloaded the following SDK: https://www.microsoft.com/en-us/download/confirmation.aspx?id=40321

    If I do not do ILMerging so What can I do with reference assemblies?

    Thank You

  • Verified answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi all

    I used CRM 2015 SDK and as per Gopalan Bhuvanesh answer You don't need to do IL merging to add these Microsoft assemblies. I do this. It solved my problem.

    Thank You

  • yleclerc Profile Picture
    1,549 on at

    Hi Abdul,

    How did you resolve your issue? You just replaced 2013 SDK by version 2015?

    I'm getting the same error, but in CRM 2016.

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Yvan Leclerc

    Yes, this is my solution.

    Can you please use plugin registration tool from XRM Tool Box? Ithink will solve your problem.

    If you need something more do let me know.

    Thanks

    Regards,

    AW

  • yleclerc Profile Picture
    1,549 on at

    Thank you Abdul,

    I tried replacing the references by newer ones, but not luck. I also use the plugin registration tool from XRMToolBox, but still no luck.

    Since I used it in other CRM instances, I exported it in an Unmanaged solution and imported it in my new instance.

    Weirdly enough, now I can update the plugin with no problem. But if I remove it and try to register again, it doesn't work. As long as I can move forward...!

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Yvan Leclerc,

    Can you please show me the error log?

    Thanks

    Regards,

    AW

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ZS-27011425-0 Profile Picture

ZS-27011425-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans