更新插件注册时“插件程序集全名必须是唯一的”

cja*_*cja 3 dynamics-crm dynamics-crm-2011

内部部署 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)
        {

        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这是成功的。

然后我把代码改成这样:

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.");

        }
    }
}
Run Code Online (Sandbox Code Playgroud)

当我使用插件注册工具更新程序集时,我在按下更新所选插件时收到此错误:

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)
Run Code Online (Sandbox Code Playgroud)

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

我做错了什么?

Dav*_*ark 8

这通常是由以下两个原因之一引起的:

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

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