It is a Boolean property for XML object in [tag:.net] applications that gets or sets a value that specifies whether or not the XmlSerializer serializes a public field or public read/write property.
Questions tagged [xmlignore]
16 questions
8
votes
1 answer
C# Attribute XmlIgnore and XamlWriter class - XmlIgnore not working
I have a class, containing a property Brush MyBrush marked as [XmlIgnore]. Nevertheless it is serialized in the stream causing trouble when trying to read via XamlReader.
I did some tests, e.g. when changing the visibility of the Property (to…

Horst Walter
- 13,663
- 32
- 126
- 228
6
votes
1 answer
XmlIgnoreAttribute, only used during serialization, not during deserialization?
Am I right in understanding the .NET XmlIgnoreAttribute, which says:
Instructs the Serialize method of the XmlSerializer not to serialize the public field or public read/write property value.
that:
The property will be deserialized, if present in…

Lasse V. Karlsen
- 380,855
- 102
- 628
- 825
4
votes
2 answers
Ignoring the null value in XML Serialization
I have a piece of xml that looks something like
01
123456
…

Zal
- 43
- 3
4
votes
1 answer
Is it possible to add XmlIgnore attribute in derived classes?
I have class Animal and classes Dog and Cat inheriting from it. Class Animal has property X.
I would like to generate XML for "Dog" without "X" property and for "Cat" with "X" property. XmlIgnore doesn't work here in the way I expected.
I tried to…

Zygmuntix
- 339
- 3
- 13
3
votes
3 answers
XmlIgnore not working
I have an object that I am trying to serialise and the output looks something like this:
-
blabla
where Item is a class that the class root uses.…

Marcom
- 4,621
- 8
- 54
- 78
3
votes
0 answers
How to serialize properties with XmlIgnore with json.net
I have a model that i retrieve as json and as xml.
I want to seralize different properties for Json that for xml.
[Serlializable]
class Model
{
public bool? IncludeAlways {get;set;}
[XmlIgnore]
public bool? IncludeForJson…

Iker
- 31
- 4
2
votes
1 answer
Understanding System.Xml.Serialization.XmlIgnoreAttribute with base classes
I have two classes, shown below:
[Serializable]
[XmlInclude(typeof(SomeDerived))]
public class SomeBase
{
public string SomeProperty { get; set; }
}
public class SomeDerived : SomeBase
{
[XmlIgnore]
public new string SomeProperty { get;…

Richard Ev
- 52,939
- 59
- 191
- 278
2
votes
3 answers
Using XmlAttributeOverrides on Nested Properties
I am trying to use XmlAttributeOverrides to control which class properties appear in the xml after the class has been serialized. It works on properties that are on the "root" class but not on nested properties. Here is a simple example to…

user1437872
- 45
- 1
- 2
- 8
1
vote
1 answer
MVC3 application
I'm working on an MVC3 application.
I created my POCO classes through the ADO.NET DbContext Generator and
I'm using partial classes to add validation on properties.
Now, when I try to serialize one of my entities I receive this error:
"Cannot…

Daniela
- 11
- 1
1
vote
1 answer
XmlIgnore on a property inside a list
How do I ignore the property which is in a type within a list of another type which I am trying to serialize?
public string SerializeTag(List reservedTags)
{
string timestampFilenamePrefix =…

KWC
- 109
- 1
- 8
1
vote
1 answer
ASP.NET Core Xml serialize data anotation XmlIgnore
I am looking for some equivalent for [XmlIgnore] anotation from .NET framework 4.6 in .NET Core. Any Ideas please?

Daniel Rusnok
- 449
- 1
- 7
- 14
0
votes
1 answer
C# xml Serialize with XmlIgnore and Deserialize problem
Hello I have problem with deserialize xml
First I have class like that
public class ReportsViewModel
{
private DateTime fromDateTime;
[XmlIgnore]
public DateTime FromDateTime
{
get { return fromDateTime; }
set
…

Oscar.Y
- 15
- 4
0
votes
1 answer
Edit Entity Framework template file .tt for XmlIgnore
I have Entity Framework 6 template file. I would like to include [XmlIgnore] on public virtual ICollection as it can not be serialized.
This template file generates designer class and I do not want to edit designer class to include [XmlIgonre] by…

BSave
- 11
- 4
0
votes
1 answer
Serialization How to dynamicly ignore all members of a specific type
I want to ignore all elements of Dictionary while serializing as those members cause an exception
example class:
public class TestClass{
public string StringTest { get; set; }
public int IntTest { get; set; }
public Dictionary

MichaelD
- 8,377
- 10
- 42
- 47
0
votes
0 answers
xml serialization attributes
Is there an xml serialization attribute tor a class member to serialize that member only if the member is not null? I need something like if the member is null, that member should behave like it had the attribute XmlIgnore?
Regards

Buda Gavril
- 21,409
- 40
- 127
- 196