Fixed – System.FormatException: Input string was not in a correct format exception while registering Plugin in Dynamics 365


We might get the below error while trying to register a plugin.




Cause

The plugin project was referring the .NET Framework 4.7.2


And the latest version of Microsoft.CrmSdk.CoreAssemblies – (Sept 29, 2020)

2020-11-10_19-33-39

Resolution –

Changing it to 4.6.2 fixed it.



Details-

Unhandled Exception: System.ServiceModel.FaultException

An unexpected error occurred.

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 Microsoft.Xrm.Tooling.Connector.CrmServiceClient.Create(Entity entity)

at Xrm.Sdk.PluginRegistration.Forms.PluginRegistrationForm.btnRegister_Click(Object sender, EventArgs e)

Detail:

<OrganizationServiceFault xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts&#8221; xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”&gt;

<ActivityId>6906e911-4a07-487a-bdf0-ad52914b9f14</ActivityId>

<ErrorCode>-2147220970</ErrorCode>

<ErrorDetails xmlns:a=”http://schemas.datacontract.org/2004/07/System.Collections.Generic”&gt;

<KeyValuePairOfstringanyType>

<a:key>ApiExceptionSourceKey</a:key>

<a:value i:type=”b:string” xmlns:b=”http://www.w3.org/2001/XMLSchema”>Plugin/Microsoft.Crm.ObjectModel.PluginAssemblyService</a:value&gt;

</KeyValuePairOfstringanyType>

<KeyValuePairOfstringanyType>

<a:key>ApiOriginalExceptionKey</a:key>

<a:value i:type=”b:string” xmlns:b=”http://www.w3.org/2001/XMLSchema”>Microsoft.Crm.CrmException: An unexpected error occurred. —&gt; 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.&lt;&gt;c__DisplayClass5_0.&lt;RunStep&gt;b__0()</a:value>

</KeyValuePairOfstringanyType>

<KeyValuePairOfstringanyType>

<a:key>ApiStepKey</a:key>

<a:value i:type=”b:guid” xmlns:b=”http://schemas.microsoft.com/2003/10/Serialization/”>3ecabb1b-ea3e-db11-86a7-000a3a5473e8</a:value&gt;

</KeyValuePairOfstringanyType>

<KeyValuePairOfstringanyType>

<a:key>ApiDepthKey</a:key>

<a:value i:type=”b:int” xmlns:b=”http://www.w3.org/2001/XMLSchema”>1</a:value&gt;

</KeyValuePairOfstringanyType>

<KeyValuePairOfstringanyType>

<a:key>ApiActivityIdKey</a:key>

<a:value i:type=”b:guid” xmlns:b=”http://schemas.microsoft.com/2003/10/Serialization/”>6906e911-4a07-487a-bdf0-ad52914b9f14</a:value&gt;

</KeyValuePairOfstringanyType>

<KeyValuePairOfstringanyType>

<a:key>ApiPluginSolutionNameKey</a:key>

<a:value i:type=”b:string” xmlns:b=”http://www.w3.org/2001/XMLSchema”>System</a:value&gt;

</KeyValuePairOfstringanyType>

<KeyValuePairOfstringanyType>

<a:key>ApiStepSolutionNameKey</a:key>

<a:value i:type=”b:string” xmlns:b=”http://www.w3.org/2001/XMLSchema”>System</a:value&gt;

</KeyValuePairOfstringanyType>

<KeyValuePairOfstringanyType>

<a:key>ApiExceptionCategory</a:key>

<a:value i:type=”b:string” xmlns:b=”http://www.w3.org/2001/XMLSchema”>SystemFailure</a:value&gt;

</KeyValuePairOfstringanyType>

<KeyValuePairOfstringanyType>

<a:key>ApiExceptionMesageName</a:key>

<a:value i:type=”b:string” xmlns:b=”http://www.w3.org/2001/XMLSchema”>UnExpected</a:value&gt;

</KeyValuePairOfstringanyType>

<KeyValuePairOfstringanyType>

<a:key>ApiExceptionHttpStatusCode</a:key>

<a:value i:type=”b:int” xmlns:b=”http://www.w3.org/2001/XMLSchema”>400</a:value&gt;

</KeyValuePairOfstringanyType>

</ErrorDetails>

Hope it helps..



 

Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

9 thoughts on “Fixed – System.FormatException: Input string was not in a correct format exception while registering Plugin in Dynamics 365”

Please share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Power Spark

Power Spark By Shrangarika

Van Carl Nguyen

Exploration of Power Platform

My Trial

It is my experience timeline.

Power⚡Thomas

Sharing my knowledge and experience about the Microsoft Power Platform.

Arpit Power Guide

a guide to powering up community

Welcome to the Blog of Paul Andrew

Sponsored by Cloud Formations Ltd

Deriving Dynamics 365

Deriving Solutions and features on Power Platform/Dynamics 365

The CRM Ninja

Thoughts & musings from a Dynamics 365 Ninja!

D CRM Explorer

Learn about Microsoft Dynamics CRM Power Platform customization and implementation and other cool stuffs

Stroke // Jonas Rapp

I know pre-stroke. I will improve who I was.

Power Melange

Power Melange By Shalinee

Clavin's Blog

Power Automate - Power Apps - SharePoint Online - Azure - Nintex - K2 - Artificial Intelligence

Sat Sangha Salon

An Inquiry in Being

The Indoencers

The Influencers & Influences of Indian Music

Monika Halan's blog

Hand's-free money management

D365 Demystified

A closer look at Microsoft Dynamics 365.

Microsoft Mate (msftmate) - Andrew Rogers

Experienced consultant primarily focused on Microsoft Dynamics 365 and the Power Platform

Knowhere365

Specific topics by Django Lohn on the whole Microsoft365 Stack

Manmit Rahevar's Blog

One Stop Destination for Microsoft Technology Solutions

MG

Naturally Curious

Brian Illand

Power Platform and Dynamics 365

Steve Mordue MVP

A Microsoft Business Applications MVP

Subwoofer 101

Bass defines your home theater

SQLTwins by Nakul Vachhrajani

SQL Server tips and experiences dedicated to my twin daughters.

Everything D365

Discovering Azure DevOps and D365 Business Applications

Tech Wizard

Lets do IT Spells

XRM Tricks (Power Platform & Dynamics CRM )

Power Platform & Dynamics CRM

CRM TIPS BY PRM

Mail to crmtipsbyprm@gmail.com for queries and suggestions

nijos.dev

Giving back to the community what I have learned

xrm CRM Dynamics

Dynamics CRM Technical & Functional Info

Dynamics 365 Blogs - Explained in unique way

Sometimes you need to look at things from different perspective.

CRM Keeper

Dynamics 365 Customer Engagement, CRM, Microsoft CRM, Dynamics CRM