Reputation: 29441
Is there any way to prevent properties from being XML-serialized in .NET Core (which we would typically do using the [XmlIgnore]
attribute before)?
Upvotes: 2
Views: 738
Reputation: 321
You can add the System.Xml.Serialization package through NuGet.
Right-click Solution -> Manage Packages for Solution
Search for "System.Xml.Serialization" and add it to the projects that need it.
This has allowed me to use [XmlIgnore] attribute with .Net Standard 1.2
Upvotes: 2
Reputation: 12480
XmlIgnore is not in .net core (Or .net standard 1.6 which is probably more important).
This page here on Github states that .net standard 2.0 will have XmlIgnore included (You can check further by viewing the raw diff between 1.6 and 2.0 here
Upvotes: 2