-Fixed deserializer attempting to populate JSON onto an object that was created with a non-default constructor

-Added GetResolvedPropertyName to DefaultContractResolver
This commit is contained in:
James Newton-King
2012-05-27 21:29:02 +12:00
parent 2fbf5f7808
commit aef0759038
9 changed files with 132 additions and 26 deletions
@@ -521,7 +521,7 @@ namespace Newtonsoft.Json.Serialization
if (!JsonTypeReflector.FullyTrusted)
{
throw JsonSerializationException.Create(null, writer.ContainerPath, @"Type '{0}' implements ISerializable but cannot be serialized using the ISerializable interface because the current application is not fully trusted and ISerializable can expose secure data.
To fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add to JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true.".FormatWith(CultureInfo.InvariantCulture, value.GetType()), null);
To fix this error either change the environment to be fully trusted, change the application to not deserialize the type, add JsonObjectAttribute to the type or change the JsonSerializer setting ContractResolver to use a new DefaultContractResolver with IgnoreSerializableInterface set to true.".FormatWith(CultureInfo.InvariantCulture, value.GetType()), null);
}
contract.InvokeOnSerializing(value, Serializer.Context);