Softstuff Consulting
My occasional musings of a technical nature
  • Send us a message
  • About Softstuff Consulting
  • Privacy Policy
  • Main Website
C# , Dynamics365

Registering a Dynamics365 plugin and I get an error

by Ian Blair May 30, 2020 No Comments

You know you are having one of those days when even doing something simple like registering a plugin in Dynamics365 doesn’t work.  Its something I have done literally thousands of times before and everything seemed to look ok until I pressed the Register Selected Plugins button in the registration tool. I had written the plugin myself, it was really simple, it loaded with no issues in the registration tool, I could see the function in the assembly correctly, Sandbox was selected as was database but each time it failed to register.

It was driving me nuts.

I checked the code, everything was public that needed to be, the assembly was signed but still no luck.

The error I got was : unexpected error occurred. —> System.FormatException: Input string was not in a correct format.

<a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">Microsoft.Crm.CrmException: An unexpected error occurred. ---> System.FormatException: Input string was not in a correct format.
   at System.Text.StringBuilder.FormatError()
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object arg0, Object arg1)
   at Microsoft.Crm.ObjectModel.TargetFrameworkVersionValidator.ValidateInternal()
   at Microsoft.Crm.ObjectModel.PluginValidatorBase.Validate()
   at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.ValidateAssemblyMetadata(ExecutionContext context, IBusinessEntity pluginAssembly, CrmPluginAssemblyMetadata assemblyMetadata)
   at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.VerifyRegistrationAbility(IBusinessEntity pluginAssembly, Boolean createCall, ExecutionContext context, CrmPluginAssemblyMetadata assemblyMetadata)
   at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.ValidateOperation(String operationName, IBusinessEntity entity, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.SdkEntityServiceBase.CreateInternal(IBusinessEntity entity, ExecutionContext context, Boolean verifyAction)
   --- End of inner exception stack trace ---
   at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)
   at Microsoft.Crm.Extensibility.Pipeline.<>c__DisplayClass3_0.<RunStep>b__0()</a:value>

 

Not very helpful, there are no input strings and I am not trying to format them.

Finally I worked it out, when I had created the project for the plugin in Visual Studio I just accepted the defaults of Dot Net 4.7.2. I added the relevant components for Dynamics365 in NuGet and ignored the fact that they are only Dot Net 4.6.2 assemblies, and carried on writing code.

That was the problem, as of 30th May 2020 nothing higher than Dot Net 4.6.2 is supported in the cloud, so an easy fix is to make sure the target version of your assembly is correct and recompile.

After that it registered first time.

Result.

dot net versionsdymamics365pluginsRegistration Tool

  • Previous Going back in time with Dynamics3655 years ago
  • Next A Dynamics365 plugin thought experiment5 years ago

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How to make your Powershell scripts more annoying
  • What motherboard is in my PC
  • A Dynamics365 plugin thought experiment
  • Registering a Dynamics365 plugin and I get an error
  • Going back in time with Dynamics365

Categories

  • Bootstrap
  • C#
  • CSS
  • Dot Net Core
  • Dynamics365
  • JavaScript
  • Powershell
  • T-SQL
  • Thoughts
  • VBScript
  • Visual Studio
  • Windows
  • Xamarin

Recent Comments

  • S0ftStuffB055 on Call a Dynamics365 workflow from JavaScript
  • Siva on Call a Dynamics365 workflow from JavaScript
  • TC Sharpe on Throw exceptions in Dynamics365 workflow plugins, or don’t
  • BigOwl on Throw exceptions in Dynamics365 workflow plugins, or don’t
  • CRMGod on Access a Dynamics365 embedded webresource

Archives

  • January 2021
  • May 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • June 2019
  • May 2019
  • February 2019
2025 Softstuff Consulting. Donna Theme powered by WordPress
  • Twitter