2013-10-14 132 views
0

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) 
     { 

     } 
    } 
} 

這是成功的。

然後我的代碼改成這樣:

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) 

發生同樣的錯誤:

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

     } 
    } 
} 

當我使用插件註冊工具我得到按下更新所選插件這個錯誤更新組件如果我將代碼恢復到第一個版本並嘗試更新程序集。

我做錯了什麼?

+0

您是否在增加版本號後嘗試過? – Scorpion

+0

你必須是管理員(http://crmdm.blogspot.com/2011/06/plugin-registration-tool-error-in-crm.html)我假設你是? – Daryl

+0

如果您試圖再次添加程序集 - daft問題,通常會發生這種情況,但您確定要更新現有程序集而不是嘗試添加新程序集嗎? – glosrob

回答

0

在動態CRM 2011插件和工作流程程序集中,只要名稱,公鑰,主要版本和次要版本的現有和新的程序集都相同,就可以更新。如果你的程序集的次要版本增加了(你的VS版本可能會自動完成這個),那麼兩者都被認爲是不同的。

然而,它們可以並排註冊。只需註冊新版本並刪除舊版本。

0

這通常出現兩個原因之一:

  1. 你點擊註冊而不是更新在插件註冊工具

  2. 你點擊更新但您選擇了錯誤的插件/工作流程組件進行更新。