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. ---> 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.<>c__DisplayClass2_1.<Execute>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.
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.
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