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

Charan Raju C R picture Charan Raju C R · Feb 14, 2012 · Viewed 36.2k times · Source

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

Answer

patricgh picture patricgh · May 28, 2012

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>