Json由Jil抛出异常反序列化

Json由Jil抛出异常反序列化,json,jil,Json,Jil,我有一段代码: //JSON is in Jil library var a = JSON.Deserialize(@"{""PhoneNumber"": ""09214523155"",""Password"": ""1928160"",""Token"": ""string"",""SubSystem"": ""string"",""Version"": 0,""DeviceType"": 0} ", typeof(LoginContactInput), Options.ISO8601);

我有一段代码:

//JSON is in Jil library
var a = JSON.Deserialize(@"{""PhoneNumber"": ""09214523155"",""Password"": ""1928160"",""Token"": ""string"",""SubSystem"": ""string"",""Version"": 0,""DeviceType"": 0} ", typeof(LoginContactInput), Options.ISO8601);
它是我的
LoginContactInput
类和
DeviceType
enum:

public class LoginContactInput 
{
    public string PhoneNumber { get; set; }
    public string Password { get; set; }
    public string Token { get; set; }
    public string SubSystem { get; set; }
    public int Version { get; set; }
    public DeviceType DeviceType { get; set; } //DeviceType is an Enum
}
 public enum DeviceType
{
    Mobile,
    Server
}
但这会引发一个异常,该异常表示:
预期字符:“”

我认为我的json是正确的


有什么问题吗?

您可以添加
LoginContactInput
(以及它使用的任何其他类型)的定义吗?这可能与JSON字符串不匹配。@KevinMontrose如果我从它工作的字符串中删除“DeviceType”,为什么?您可以添加
LoginContactInput
(以及它使用的任何其他类型)的定义吗?这可能与JSON字符串不匹配。@KevinMontrose如果我从字符串中删除“DeviceType”,它会工作,为什么?