Serialization error in .net core 2.0, same code was working in .net core 1.1
public class CustomClass { [Required] public System.Guid? clientId { get; set; } }
"\"bb2f3da7-bf79-4d14-9d54-0a1f7ff5f902\""
system.argumentexception Could not cast or convert from System.String to System.Guid. newtonsoft.json
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
I can not change client call who calling API with "\"bb2f3da7-bf79-4d14-9d54-0a1f7ff5f902\"". Client has code freeze.
Hi .net core 1.1 : When we return string from api it like "bb2f3da7-bf79-4d14-9d54-0a1f7ff5f902" .net core 2.0
"\"bb2f3da7-bf79-4d14-9d54-0a1f7ff5f902\""
@ViktorHofer @danmosemsft can you take a look?
@chintan3100 I spent some time trying to reproduce your issue but I don't have enough information to understand what's going on here.
Please post a small reproduction code. I don't know which APIs you are using (even it they aren't .NET Core related but Json.NET).
@ViktorHofer can you move this issue over to dotnet/corefx to track it?
Issue moved to dotnet/corefx #24473 via ZenHub