3

内部部署 Dynamics CRM 2011。

我使用插件注册工具注册了一个自定义工作流程序集。

插件代码是:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;

namespace CreateDirectDebit
{
    public class CreateDirectDebit : CodeActivity
    {
        protected override void Execute(CodeActivityContext context)
        {

        }
    }
}

这是成功的。

然后我将代码更改为:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Activities;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Workflow;

namespace CreateDirectDebit
{
    public class CreateDirectDebit : CodeActivity
    {
        protected override void Execute(CodeActivityContext context)
        {
            // Create the tracing service
            ITracingService tracingService = context.GetExtension<ITracingService>();
            if (tracingService == null)
                throw new InvalidPluginExecutionException("Failed to retrieve the tracing service.");

            tracingService.Trace("CreateDirectDebit.Execute, 1");


            throw new InvalidPluginExecutionException("Testing dialog custom workflow.");

        }
    }
}

当我使用插件注册工具更新程序集时,按更新选定插件时出现此错误:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Plug-in assembly fullnames must be unique (ignoring the version build and revision number).
Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ErrorCode>-2147204741</ErrorCode>
  <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Plug-in assembly fullnames must be unique (ignoring the version build and revision number).</Message>
  <Timestamp>2013-10-14T10:04:55.4528719Z</Timestamp>
  <InnerFault>
    <ErrorCode>-2147204741</ErrorCode>
    <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>Plug-in assembly fullnames must be unique (ignoring the version build and revision number).</Message>
    <Timestamp>2013-10-14T10:04:55.4528719Z</Timestamp>
    <InnerFault i:nil="true" />
    <TraceText i:nil="true" />
  </InnerFault>
  <TraceText i:nil="true" />
</OrganizationServiceFault>

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.Update(Entity entity)
   at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.UpdateCore(Entity entity)
   at Microsoft.Crm.Tools.PluginRegistration.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type)
   at Microsoft.Crm.Tools.PluginRegistration.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)

如果我将代码恢复到第一个版本并尝试更新程序集,则会发生同样的错误。

我做错了什么?

4

4 回答 4

8

这通常是由于以下两个原因之一:

  1. 您在插件注册工具中单击了注册而不是更新

  2. 您单击了更新,但您选择了错误的插件/工作流程序集进行更新。

于 2018-01-23T15:26:34.113 回答
1

在 Dynamics CRM 2011 中,插件和工作流程序集可以更新,只要现有程序集和新程序集的名称、公钥、主要版本和次要版本相同。如果您的程序集的次要版本已增加(您的 VS 构建可能已自动完成此操作),则两者都被认为是不同的。

但是,它们可以并排注册。只需注册新版本并删除旧版本即可。

于 2014-03-14T21:08:14.847 回答
1

您的程序集必须使用完整的强名称匹配进行强签名。两个最有可能的罪魁祸首是版本号,以及您使用不同的密钥对程序集进行签名。

我写了一篇包含更多信息的博客文章:

插件程序集的全名必须是唯一的 http://helpfulbit.com/plugin-assemby-fullnames-must-be-unique/

于 2020-09-11T03:38:54.023 回答
1

就我而言,我在尝试更新插件时收到此错误。

我选择在该Registered Plugins & Custom Workflow Activities区域更新的插件不正确。名字非常相似,所以我一开始没有注意到。

通过从列表中选择要更新的正确插件,我能够继续更新。

于 2019-10-10T04:06:55.397 回答