简体   繁体   中英

.Net Core 2.2 XML Serialization/Deserialization

I am unable to serialize/deserialize XML in .Net Core 2.2.

I am receiving the following exception: System.TypeLoadException: 'Could not load type 'System.ServiceModel.Dispatcher.XPathMessageFilter' from assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.'

I have Googled, of course, to no avail thus far.

I have added the System.ServiceModel.Primitives NuGet package but the XPathMessageFilter type isn't contained in that package. Has anyone had success with this issue?

You should use System.Xml Namespace for serializing/de-serializing and navigating XML documents in dotnet core.

System.ServiceModel Namespace works with dotnet framework.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM