It is a little complicated, but you can. Change your code to:
var parsed = (CarEntity)JsonConvert.DeserializeObject(jsonString, typeof(CarEntity), new JsonSerializerSettings() { MissingMemberHandling = MissingMemberHandling.Error, Error = ErrorHandler });
And add:
private static void ErrorHandler(object x, ErrorEventArgs error) { Console.WriteLine(error.ErrorContext.Error); error.ErrorContext.Handled = true; }
You should probably do more with the last line, because now every error does not throw an exception.
UPDATE
Decompiled code throwing an exception in Json.NET:
if (this.TraceWriter != null && this.TraceWriter.LevelFilter >= TraceLevel.Verbose) this.TraceWriter.Trace(TraceLevel.Verbose, JsonPosition.FormatMessage(reader as IJsonLineInfo, reader.Path, StringUtils.FormatWith("Could not find member '{0}' on {1}", (IFormatProvider) CultureInfo.InvariantCulture, (object) propertyName, (object) contract.UnderlyingType)), (Exception) null); if (this.Serializer.MissingMemberHandling == MissingMemberHandling.Error) throw JsonSerializationException.Create(reader, StringUtils.FormatWith("Could not find member '{0}' on object of type '{1}'", (IFormatProvider) CultureInfo.InvariantCulture, (object) propertyName, (object) contract.UnderlyingType.Name)); reader.Skip();
source share