1

I need to call some Dynamics 2011 CRM WebServices from a WebApi build on .Net Core 2.1.

To use CRM SDK I need these dependencies : - Microsoft.Xrm.Sdk.2011 5.0.18 - Microsoft.Crm.Sdk.Proxy.2011 5.0.18 - Microsot.IdentityModel 6.1.7600.16394

When I call my method this exception is raised :

System.TypeLoadException : 'Could not load type 'System.ServiceModel.Description.MetadataConversionError' from assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.'
   at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri, Boolean checkForSecondary)
   at Microsoft.Xrm.Sdk.Client.OrganizationServiceConfiguration..ctor(Uri serviceUri)
   at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateManagement[TService](Uri serviceUri)

Is there any workaround to avoid this exception ?

This problem also occurs in IIS Express and aspnet_regiis -iru could no be applied. I think it is more a .Net Core issue with 4.5 assemblies.

Thanks in advance.

E.T.
  • 31
  • 6
  • Possible duplicate of [Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel](https://stackoverflow.com/questions/15688930/could-not-load-type-system-servicemodel-activation-httpmodule-from-assembly-s) – James Wood Jan 07 '19 at 21:30
  • 1
    Not a duplicate, problem occurs also in IIS Express and also if hosted beyond Kestrel. I think it is a .Net Core compatibility issue with older assemblies... – E.T. Jan 08 '19 at 08:02

0 Answers0