Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7813841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:59:56+00:00 2026-06-02T04:59:56+00:00

I have a custom workflow activity assembly that is referenced by two workflows. The

  • 0

I have a custom workflow activity assembly that is referenced by two workflows. The assembly is currently at version 1.0.builddate.revision.

I’ve recompiled an update to the assembly. It is now at 1.1.builddate.revision.

Based on information I found here I believe that since I’m changing the minor number in the assembly version, that would need to perform an upgrade (not an update) of the custom workflow activity.

My understanding of an upgrade is essentially that I should just register a new assembly and then point the process workflows at the new revision of the custom activities.

However, when I attempt to register the assembly (programmatically), I get a FaultException stating nothing more than “Cannot insert duplicate key.”

System.ServiceModel.FaultException<Microsoft.Xrm.Sdk.OrganizationServiceFault> was caught
  Message=Cannot insert duplicate key.
  Source=mscorlib
  Action=http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/CreateOrganizationServiceFaultFault
  StackTrace:
    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 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Xrm.Sdk.IOrganizationService.Create(Entity entity)
       at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.CreateCore(Entity entity)
       at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Create(Entity entity)
       at PluginRegistrationTool.XrmService.Create(Entity entity) in C:\Workspaces\xxxxxx\Lib\PluginRegistrationTool\PluginRegistrationTool\XrmService.cs:line 390
  InnerException: 

I can only guess at what key this fault refers to. At first I thought that maybe I was trying to upload an old copy of the assembly (potentially one that was still v1.0.x.x), but I can check via Intellisense that I am in fact uploading a newer version of the assembly than exists in the org I’m attempting to register in. Everything about the custom activity assembly is the same except for the AssemblyVersion number.

What am I not getting about this process? I don’t need to know how to update the workflow to point to the new assembly… I just want to know how to upload an updated custom workflow activity assembly to CRM successfully.

The code that is attempting to upgrade the custom workflow activity assembly is a slightly modified version of this. The PluginRegistrationTool on that codeplex site is a modified version of the PluginRegistrationTool that comes with the CRM SDK. This version turns the PluginRegistrationTool into a command line utility that I’m using in our build process.

I’ve modified the Register function in this file to handle the update vs upgrade scenarios by comparing the Major/Minor portion of the AssemblyVersion number of the assembly in CRM with the version number of the assembly I’m attempting to upload. I can see that it is attempting an upgrade (creating a new assembly), but then I get the exception I mentioned earlier on the

organizationServiceProxy.Create(entity);

or line 390 of the code in this file.

One important thing to note is that I can perform the upgrade using the GUI PluginRegistrationTool from the SDK, just not with this commandline version of the tool. Also, I get the same error message if I try to import a managed solution with an “upgraded” version of the custom workflow activity assembly on top of a managed solution with an older version of the assembly.

Thanks in advance for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T04:59:58+00:00Added an answer on June 2, 2026 at 4:59 am

    I was creating the new assembly by passing in an the existing assemblies assemblyid. This was causing the duplicate key exception when I called proxy.Create(). Once I assigned a new Guid to the assemblyid property of the assembly entity, the proxy.Create() function call worked just fine.

    Thanks for the help on this!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom workflow activity that copies attachments from a case to
I have created a custom workflow activity in CRM that creates a task. The
I currently have a custom workflow activity to run an external process, after the
I have created a custom activity that I am using in my workflows. Initially
I have created a custom CRM activity that I'm using in a workflow. I'm
I have custom classes that I currently instantiate within App.xaml as resources. I want
I've created a custom workflow activity for TFS 2010 to customize the assembly versioning.
I am trying to develop a custom activity for my sharepoint workflow that would
I have a workflow which has a custom activity which calls a web service.
For MS CRM 2011 I have made custom workflow activity, but I'm not able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.