Error registering plugins and/or workflows. Plug-in assembly does not contain the required types or assembly content cannot be updated

37,346

Solution 1

If you are deployong your custome workflows via CRM development toolkint and package and then after that if you have changed any class name or namespace, you must change RegisterFile.crmregister file manually as Visual Studio does not do it for you. So if you change your class name from A to B and your namespace from N to M then 'TypeName' from the below xml in RegisterFile.crmregister file must be as following:

 <?xml version="1.0" encoding="utf-8"?>
<Register xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/crm/2011/tools/pluginregistration">
  <Solutions>
    <Solution Assembly="PackageECRProcesses.CleanRegistration.dll" Id="ab72673b-c0a8-e111-af82-080027dd322f" IsolationMode="None" SourceType="Database">
      <WorkflowTypes>
        <WorkflowType FriendlyName="any" Name="any" Description="any." WorkflowActivityGroupName="account" Id="f0e3f436-c1a8-e111-af82-080027dd322f" TypeName="M.B" />
      </WorkflowTypes>
    </Solution>
  </Solutions>
  <XamlWorkflows />
</Register>

Solution 2

In our case we used ILMerge and accidentally we merged Microsoft.Xrm.Sdk.dll into our plugin, removing this dll (copy local = false) fixed the issue.

This merged dll was not working anyway as it throw security exception

Inheritance security rules violated while overriding member: 'Microsoft.IdentityModel.Claims.ClaimsIdentity.System.Runtime.Serialization.ISerializeable.GetObjectData

this GetObjectData was present in Microsoft.Xrm.Sdk.dll hence security exception from SandBox deployment.

Solution 3

I just encountered the exact same issue while toying with the CRM Toolkit.

This is how I solved the issue:

  1. Go to Settings/Solutions/Yoursolution in CRM
  2. Delete the SDK message processing entries related to the Plugin assembly
  3. Delete the plugin assembly itself from the solution
  4. Go back to Visual Studio and Deploy

I didn't have to manually edit anything.

Solution 4

You may need to check if the plugin with the same name exists as a registered plugin on the organization. Unregister the plugin and register the assembly and steps again.

Solution 5

Try to change assembly version.

Share:
37,346
Charan Raju C R
Author by

Charan Raju C R

Updated on July 09, 2022

Comments

  • Charan Raju C R
    Charan Raju C R almost 2 years

    I implemented one custom workflow in in Visual Studio 2010 using CRM 2011 Developer Toolkit. It was working fine with system generated namespace. But, when I changed the namespace of my project, its throwing an error "Error registering plugins and/or workflows. Plug-in assembly does not contain the required types or assembly content cannot be updated." while deploying it. And I have changed the namespace in .crmregister file, project properties and in source code. Then whats the problem here.?

  • Charan Raju C R
    Charan Raju C R about 12 years
    Yes. I'm using Microsoft.Xrm.Sdk, Microsoft.Xrm.Sdk.Query and Microsoft.Xrm.Sdk.Workflow. And what all I need to merge..? Can u give me a syntax of merging it..? I'm not aware of ILMerge.
  • Jason Lattimer
    Jason Lattimer about 12 years
  • Maarten Docter
    Maarten Docter over 9 years
    I had this same error. When I changed the assembly version to match exactly with the one deployed, it finally worked.
  • abarisone
    abarisone almost 9 years
    Could you please elaborate more your answer adding a little more description about the solution you provide?
  • AnkUser
    AnkUser over 5 years
    Could relate to the issue. Thanks.
  • Endi Zhupani
    Endi Zhupani over 5 years
    Wow thanks! wasted hours on this issue until I found this
  • Farzad J
    Farzad J almost 5 years
    thanks for the help , I got the same problem, could you please let me know where is the location of RegisterFile.crmregister?