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.

Exception when Deserializing Empty List When Emit(Behavior) is Set

See original GitHub issue

Example class:

public class Foo
{
	public List<string> Baz { get; } = new List<string>();
}

Baz does not have a setter. When trying do deserialize a serialized XML an exception occurs.

Also, somewhat related, but would it be possible to add an option for the serializer to ignore all properties without a setter?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
WojciechNagorskicommented, Oct 16, 2018

This is strange. I’ll take care of it.

1reaction
Mike-E-angelocommented, Oct 16, 2018

Bummer @wojtpl2 it still looks broken: https://www.nuget.org/packages/ExtendedXmlSerializer/

Still on 2.1.6. 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception when Deserializing Empty List When Emit(Behavior) is ...
When trying do deserialize a serialized XML an exception occurs. ... Exception when Deserializing Empty List When Emit(Behavior) is Set #216.
Read more >
JSON deserialization fails only when array is empty
On some occasions when I receive JSON whose one of the array property is empty the deserialization fails, throwing the following exception :....
Read more >
Migrate from Newtonsoft.Json to System.Text.Json - .NET
Deserialize null to non-nullable type. Newtonsoft.Json doesn't throw an exception in the following scenario: NullValueHandling is set to Ignore ...
Read more >
Empty list on serializable coming up as null instead of empty?
This is throwing me because I thought that lists could never be null. They just create empty. What is going on here and...
Read more >
Writing JSON REST Services
The JSON serialization library tries to get the list of fields of Legume and gets an empty list, so it does not serialize...
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