C# Json反序列化问题

C# Json反序列化问题,c#,json,json.net,deserialization,C#,Json,Json.net,Deserialization,在我的类中尝试反序列化此属性时,我收到以下错误消息:- 读取字符串时出错。意外标记:星光。路径“[”何时 开户时,以下哪项适用?“]”,第53行,第58位 JSON片段 "When opening the account which of these applied?": [ "option1", "option2", "option3", "option4" ] C#属性:- [J

在我的类中尝试反序列化此属性时,我收到以下错误消息:-

读取字符串时出错。意外标记:星光。路径“[”何时 开户时,以下哪项适用?“]”,第53行,第58位

JSON片段

"When opening the account which of these applied?": [
            "option1",
            "option2",
            "option3",
            "option4"
        ]
C#属性:-

[JsonProperty(PropertyName = "When opening the account which of these applied?")]
public string Whenopeningtheaccountwhichoftheseapplied { get; set; }
它是引发错误的唯一属性

使用以下语句进行Im反序列化:--

var submission=JsonConvert.DeserializeObject(json);

你知道它为什么这样做吗?

它不是一个单一的项目,而是一个数组。如果您按照以下方式更新您的类,它应该可以工作:

[JsonProperty(PropertyName = "When opening the account which of these applied?")]
public List<string> Whenopeningtheaccountwhichoftheseapplied { get; set; }
[JsonProperty(PropertyName=“开户时应用了哪些?”)]
当启用应用{get;set;}的帐户时的公共列表

您的JSON缺少大括号。这是一个片段,我知道不是完整的JSON字符串,但为了创建一个自包含的问题,您仍然应该将其设置为有效的JSON。40个字符长的变量名,您是否试图将其写入吉尼斯世界纪录?;)我使用Json.Net粘贴Json作为这些属性名的类;-)
[JsonProperty(PropertyName = "When opening the account which of these applied?")]
public List<string> Whenopeningtheaccountwhichoftheseapplied { get; set; }