Error registering plugins and/or workflows. Plug-i

2019-02-16 18:05发布

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

15条回答
甜甜的少女心
2楼-- · 2019-02-16 18:27

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.

查看更多
戒情不戒烟
3楼-- · 2019-02-16 18:28

Try to change assembly version.

查看更多
走好不送
4楼-- · 2019-02-16 18:29

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.

查看更多
叼着烟拽天下
5楼-- · 2019-02-16 18:31

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>
查看更多
够拽才男人
6楼-- · 2019-02-16 18:32

apart of above cases, check .snk file or .pfx file. Does it change in your second deployment.

in this case try to use old source code or else you need to re register the plug/workflow.

查看更多
趁早两清
7楼-- · 2019-02-16 18:36

Your version needs to be the same one as the one that has been published already for an Upgrade. We had an Assembly version of 1 major, 0 minor - and the one we tried to publish was 12 major, 0 minor.

We changed the Visual Studio solution number back to version 1.0.0.0, Build, Load Assembly, Update - and it worked!

Deleting it would NOT solve the issue due to the dependencies from Workflows if they were used.

We switched Tracing On and found the SQL script to find the culprit.

查看更多
登录 后发表回答