JsonIgnore attributes not working in ASP.NET?

I had incorrectly resolved the JsonIgnore reference.

Note that this attribute exists in more than one namespace:

  • System.Text.Json.Serialization
  • Newtonsoft.Json

I had resolved this in VS to System.Text.Json.Serialization.JsonIgnore – however I was using the Newtonsoft library for my actual Serialise/Deserialise – and hence the attribute was ignored.
Changing the reference to Newtonsoft.Json.JsonIgnore resolved.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)