Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM 9.0 plug-in issues

(0) ShareShare
ReportReport
Posted on by 395

Hi,

Recently i have upgraded my CRM 8.2 to 9.0 and started seeing most of my plug-ins are failing with error Security exception. I thought this may be because of TLS errors and converted the plug-ins to use framework 4.6.2. I am already using ILMerge and all my DLLS work fine with 8.2. After i converted to 4.6.2 and. When i run my ILMerge command and tried to register the plugin with Plug-in registration tool started seeing this error.

Changed the version to 4.6.2, didnot update the Microsoft.Crm.Sdk.Proxy and Microsoft.Xrm.Sdk dlls and ended up with below error.
-------------------------------------------------------------------------------------------------------------------------------------------------

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: This plugin 
assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 
4.5.2 and try again.
Detail: <OrganizationServiceFault xmlns="schemas.microsoft.com/.../Contracts" xmlns:i="www.w3.org/.../XMLSchema-instance">
<ActivityId>e0c7bcdc-8f7d-4d99-bc7c-baa454f8d6f5</ActivityId>
<ErrorCode>-2147204725</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic">
<KeyValuePairOfstringanyType>
<a:key>ApiExceptionSourceKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">Plugin/Microsoft.Crm.ObjectModel.PluginAssemblyService</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiOriginalExceptionKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">Microsoft.Crm.CrmException: This plugin assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 
requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again. ---&gt; Microsoft.Crm.CrmException: This plugin assembly uses 
version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try 
again.
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.UpdateInternal(IBusinessEntity entity, ExecutionContext context, Boolean verifyAction)
at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.Update(IBusinessEntity entity, ExecutionContext context)
--- 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__DisplayClass2_1.&lt;Execute&gt;b__0()</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiStepKey</a:key>
<a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../Serialization">a0cdbb1b-ea3e-db11-86a7-000a3a5473e8</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiDepthKey</a:key>
<a:value i:type="b:int" xmlns:b="www.w3.org/.../XMLSchema">1</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiActivityIdKey</a:key>
<a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../Serialization">e0c7bcdc-8f7d-4d99-bc7c-baa454f8d6f5</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiPluginSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">System</a:value>
</KeyValuePairOfstringanyType>
<KeyValuePairOfstringanyType>
<a:key>ApiStepSolutionNameKey</a:key>
<a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema">System</a:value>
</KeyValuePairOfstringanyType>
</ErrorDetails>
<Message>This plugin assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using 
.NET Framework version 4.5.2 and try again.</Message>
<Timestamp>2018-07-16T15:30:24.9317294Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>e0c7bcdc-8f7d-4d99-bc7c-baa454f8d6f5</ActivityId>
<ErrorCode>-2147204725</ErrorCode>
<ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>This plugin assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using 
.NET Framework version 4.5.2 and try again.</Message>
<Timestamp>2018-07-16T15:30:24.9317294Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</InnerFault>
<OriginalException i:nil="true" />
<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 Microsoft.Crm.Tools.Libraries.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type)

After the above error i updated the Microsoft.Crm.Sdk.Proxy and Microsoft.Xrm.Sdk dlls to use the latest version. After updating these references and when i tried to run the ILMerge manually ended up with below error.

Manual_2D00_Merge.JPG

I thought ILMerge is unable to find the correct framework version then tried passing the framework parameter as well and ended up with below error.

Manual_2D00_ILMerge_2D00_Framkeworkpath.JPG

Can some one help in finding the correct solution. What are the steps that we need to follow if we are moving to 9.0 if we are making external api calls? I am using newtonsoft and i need to use the ILMerge. These are working fine till yesterday before upgrade. I tried with Msbuild.ILMerge as well but there is no luck with that option

*This post is locked for comments

  • Account Profile Picture
    Account 10 on at
    RE: CRM 9.0 plug-in issues

    Hi Amit,

    I have build my plugin in .net framework of 4.5.2 and then register it but still facing the same issue.

    Anyone has tried anything else to make ILMerge work for 9.0 and higher version

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM 9.0 plug-in issues

    Hi SVN,

    I also faced similar problem. Please bulid your plugin in .net framework of 4.5.2 and then register it.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM 9.0 plug-in issues

    HI SVN ,

    Below are the general steps. Please let me know if you tried them.

    1.Update sdk assemblies to latest version .

    2.Install MSBuild.ILMerge.Task .

    3.Set 'Copy local' property of Newtonsoft.json as 'true' and make sure all other assemblies have it as 'false'.

    If you are facing issue, try uninstalling and installing ILMerge .

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,253 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans