Could not load type 'System.ServiceModel.Description.MetadataConversionError
See original GitHub issue@HASSEN-MEDDEB-ATOS commented on Thu Jan 30 2020
Hello again,
i have migrated my project from .NET Framework to .NET core. i have changed this line from
sp.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
to
sp.ServiceConfiguration.CurrentServiceEndpoint.EndpointBehaviors.Add(new ProxyTypesBehavior());
because we used System.ServiceModel.Primitives
but it return Exception: Could not load type ‘System.ServiceModel.Description.MetadataConversionError’ from assembly ‘System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.
Thanks for all helps
Cordially
@maryamariyan commented on Thu Jan 30 2020
@StephenBonikowsky commented on Thu Jan 30 2020
@HASSEN-MEDDEB-ATOS The types you mentioned belong to WCF. (https://github.com/dotnet/wcf)
Not all of WCF from the full framework is available in WCF Core. We are still adding support for many features but some are not yet available and others we will not be able to support. Server side APIs will not be supported in WCF Core only Client side APIs.
System.ServiceModel.Description.MetadataConversionError
is not currently supported. You can check any API in the https://apisof.net/ tool to see where it is supported.
@mconnew Is this API related to server side stuff or could it be added to the WCF Core public surface area. Looks like it was at least partially implemented in WCF Core although I don’t see any references to it.
@HASSEN-MEDDEB-ATOS commented on Fri Jan 31 2020
Helle @StephenBonikowsky ,
Thanks for your answer. I can’t undestrand somthing, System.ServiceModel is deprecated in both .NET Standard and .NET Core. I have added the new package “System.ServiceModel.Primitives” i can see that System.ServiceModel has been added in the reference with version “4.7.0”. the question, why i get System.ServiceModel, Version=4.0.0.0 not load ? even so i have installed the version 4.7.0
Cordially
@StephenBonikowsky commented on Fri Jan 31 2020
On full framework System.ServiceModel.dll contains most of the WCF implementation.
WCF Core works differently, all the implementation code lives in the System.Private.ServiceModel package but that package cannot be referenced directly. Instead we have 5 Façade packages in which the ref assembly has a list of publicly accessible APIs and the lib assembly type-forwards to the implementation in System.Private.ServiceModel.
Because the full framework supports netstandard2.0 as does WCF Core, we have included in our System.Primitives.ServiceModel package a Façade assembly called System.ServiceModel.dll for the scenario where you build your application on the full framework targeting netstandard2.0 and then run it on WCF Core. In that case the System.ServiceModel.dll Façade will type-forward to the WCF Core implementation in System.Private.ServiceModel.dll. It only knows about types that are supported on both full framework and core as per netstandard2.0.
So back to your error. You are trying to load a type that is not supported in WCF Core and the System.ServiceModel Façade knows nothing about it.
Since this is a WCF issue, I amgoing to move it to the WCF Repo.
Issue Analytics
- State:
- Created 4 years ago
- Comments:25 (9 by maintainers)
I’m in the same situation as Hassen-Meddeb-Atos, i’m trying to connect to Dynamics CRM through .Core, and am facing the same issues. so i’m curious to see the WSFederationHttpBinding implementation.
Will keep a close eye on this thread 😃
Regards
Well typical microsoft… They just everyone left behind…