.NET 4.6.1 C#
我有一个JSON对象,其中包含值列表:
我想将其转换为List。我试过这个:
//responseString contains the JSON
string responseString = await response.Content.ReadAsStringAsync();
var profile = JsonConvert.DeserializeObject<ObjectProfile>(responseString);
这是ObjectProfile:
internal class ObjectProfile
{
public List<string> Value { get; set; }
}
但代码抛出异常说:
Message = "Unexpected character encountered while parsing value: {. Path 'value', line 1, position 136."
如何达到理想的效果?感谢