简体   繁体   中英

Dual References to IXMLSerializable

I have a class that implements IXMLSerializable in a .NET Standard Library, but I can't compile the library because it's referencing IXMLSerializable in two places. The output is as follows:

error CS0433: The type 'IXmlSerializable' exists in both 'System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Xml.XmlSerializer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

I only see one reference under the dependencies though (System.Xml.XmlSerializer), which I need for the XML attributes. This is my first crack at a .Net Standard Library, so is there something I'm missing here?

Try upgrading your reference to System.Xml.XmlSerializer to version 4.1.0.0. The error message says that you have two references to the library, but are using different versions. System.Xml.ReaderWriter is using a newer version than your project is, so you need to get that version.

You could also try removing your reference to System.Xml.XmlSerializer or switching it to an older version.

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