Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.?

like image 566
Charan Raju C R Avatar asked Feb 14 '12 13:02

Charan Raju C R


4 Answers

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>
like image 151
patricgh Avatar answered Oct 30 '22 03:10

patricgh


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.

like image 44
Serge Avatar answered Oct 30 '22 01:10

Serge


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.

like image 30
Alex Avatar answered Oct 30 '22 01:10

Alex


Try to change assembly version.

like image 41
paramosh Avatar answered Oct 30 '22 02:10

paramosh