question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

cc: @dotnet/dotnet-wcf


@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:open
  • Created 4 years ago
  • Comments:25 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
JoeriBlootackercommented, Feb 20, 2020

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

2reactions
montella1507commented, Aug 27, 2021

Well typical microsoft… They just everyone left behind…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft Dynamics 365 SDK Core Assemblies .NET ...
TypeLoadException : Could not load type 'System.ServiceModel.Description.MetadataConversionError' from assembly 'System.ServiceModel, Version=4.0 ...
Read more >
Could not load type 'System.ServiceModel.Activation. ...
This error can occur when there are multiple versions of the .NET Framework on the computer that is running IIS, and IIS was...
Read more >
Could not load type system.servicemodel.activation.httpmodule
This issue occurs because the Applicationhost.config file for Windows Process Activation Service (WAS) has some tags that are not compatible with the .NET ......
Read more >
Could not load type 'System.ServiceModel.Activation. ...
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information ...
Read more >
Workaround of Record creation problem in Dynamics CRM ...
TypeLoadException : 'Could not load type 'System.ServiceModel.Description.MetadataConversionError' from assembly 'System.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found