内部部署 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)
如果我将代码恢复到第一个版本并尝试更新程序集,则会发生同样的错误。
我做错了什么?