Friday, May 30, 2014

Issues with the new Plugin Registration tool

As you might have noticed there is a new version of the plugin registration tool out with the new version of the SDK 6.1 released in may 2014. It has gotten a nice facelift in the UI and can now be found in the Tools directory.

However, I have had some issues when working with my on-premise org (it worked fine with online). I got the following error when trying to register a step on a plugin assembly.


Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Assembly file name (CRMKonsulterna.Modelon.Plugins.dll) is in invalid format. Only file name is allowed.
Detail: <OrganizationServiceFault xmlns="
http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ErrorCode>-2147204719</ErrorCode>
  <ErrorDetails xmlns:a="
http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>Assembly file name (CRMKonsulterna.Modelon.Plugins.dll) is in invalid format. Only file name is allowed.</Message>
  <Timestamp>2014-05-30T06:58:51.0596986Z</Timestamp>
  <InnerFault>
    <ErrorCode>-2147204719</ErrorCode>
    <ErrorDetails xmlns:a="
http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
    <Message>Assembly file name (CRMKonsulterna.Modelon.Plugins.dll) is in invalid format. Only file name is allowed.</Message>
    <Timestamp>2014-05-30T06:58:51.0596986Z</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.Create(Entity entity)
   at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.CreateCore(Entity entity)
   at Microsoft.Crm.Tools.PluginRegistration.RegistrationHelper.RegisterStep(CrmOrganization org, CrmPluginStep step)
   at Microsoft.Crm.Tools.PluginRegistration.StepRegistrationForm.btnRegister_Click(Object sender, EventArgs e)


I'm including it all here for searchability. I have highlighted the message that is the interesting part.

When retrying it in the older version of Plugin Registration tool, it works just fine, as long as I re-register the assemblyfile. If I keep the assembly file and try to register the step in the older version (6.0.0001.0061) I will still get the error, so I did have to unregister the entire assembly and register it all over. This also only seems to show up when registering to disk (I havn't tried registereing to GAC as I seldom use that).

Also do note that despite right clicking on the assembly-plugin and pressing "Add step" it seems to omit this information in the form for registering the step so make sure that your step is registered on the correct assembly. I got a bit confused and registered quite a few on ActivityFeeds until I noticed this.

For reference, this is for Plugin Registration Tool version 6.1.0.519 and I am testing it on CRM 2013 UR2 Onpremise.

I am also quite sure these bugs will be fixed soon by Microsoft, but it might be a good idea to keep a copy of the older Plugin registration tool just in case.

Gustaf Westerlund
MVP, CEO and owner at CRM-konsulterna AB
www.crmkonsulterna.se

6 comments:

  1. It's actually a CRM bug, not a plug-in registration tool bug.

    Edit the pluginassemblybase table and remove the path on the path column, leaving just the file name.

    Lame testers...

    ReplyDelete
  2. Hi,
    thanks for your comment. The weird thing is that it works in in the earlier version of the the tool but there might be some missmatch in the Communication and there needs to be two parts to communicate.

    ReplyDelete
  3. HI I'm new to crm and plugins. I was trying to use the registration tool to change a configuration. It acts like is saved when I click update but the RegisterFile.crmregister does not change and when the plugin runs it still reads the old value. any thoughts? is this for registering new plugins?

    ReplyDelete
  4. Not sure why it does not Work for you. Hard to say from your description. Sometimes the plugin will require re-registering, but that will require the original dll.

    ReplyDelete
  5. just one more note: the path-column should only contain the name of the assembly (like described above) incl. the extension ".dll" !
    For some reason the 2016-Pluginregistration-tool didn't add the extension to the path..

    ReplyDelete
  6. Ok, seems like this bug is resurfacing again and again for different reasons. Great that you could help out @Tobias!

    ReplyDelete