C# 无法反序列化json对象

C# 无法反序列化json对象,c#,.net,json,C#,.net,Json,我正在使用JavaScriptSerializer,当我尝试将JSON对象反序列化为 Json.Deserialize<List<HeyWatchVideo>>(Request("video")); 我的课 public class HeyWatchVideo { public DateTime Created_At { get; set; } public string Title { get; set; } public Dictionar

我正在使用JavaScriptSerializer,当我尝试将JSON对象反序列化为

Json.Deserialize<List<HeyWatchVideo>>(Request("video")); 
我的课

public class HeyWatchVideo
{
    public DateTime Created_At { get; set; }
    public string Title { get; set; }
    public Dictionary<string, string> Specs { get; set; }
    public DateTime Updated_At { get; set; }
    public int Id { get; set; }
    public string Filename { get; set; }
    public string Link { get; set; }
    public string Url { get; set; }
}

public class HeyWatchVideoSpecs
{
    public HeyWatchVideoSpecsAudio Audio { get; set; }
    public HeyWatchVideoSpecsVideo Video { get; set; }
    public string Thumb { get; set; }
    public string Mime_type { get; set; }
    public int Size { get; set; }
}

public class HeyWatchVideoSpecsVideo
{
    public int Rotation { get; set; }
    public double Aspect { get; set; }
    public string Container { get; set; }
    public string Codec { get; set; }
    public int Length { get; set; }
    public int Width { get; set; }
    public int Bitrate { get; set; }
    public string Pix_format { get; set; }
    public double Fps { get; set; }
    public double Stream { get; set; }
    public int Height { get; set; }
}

public class HeyWatchVideoSpecsAudio
{
    public int Channels { get; set; }
    public int Sample_rate { get; set; }
    public string Codec { get; set; }
    public bool Synched { get; set; }
    public int Bitrate { get; set; }
    public int Stream { get; set; }
}
公共类海沃克视频
{
在{get;set;}处创建的公共日期时间
公共字符串标题{get;set;}
公共字典规范{get;set;}
公共日期时间在{get;set;}更新
公共int Id{get;set;}
公共字符串文件名{get;set;}
公共字符串链接{get;set;}
公共字符串Url{get;set;}
}
公共类HeyWatchVideoSpecs
{
公共HeyWatchVideoSpecsAudio音频{get;set;}
公共HeyWatchVideoSpecsVideo{get;set;}
公共字符串Thumb{get;set;}
公共字符串Mime_类型{get;set;}
公共整数大小{get;set;}
}
公共类HeyWatchVideoSpecsVideo
{
公共整数旋转{get;set;}
公共双方面{get;set;}
公共字符串容器{get;set;}
公共字符串编解码器{get;set;}
公共整数长度{get;set;}
公共整数宽度{get;set;}
公共整数比特率{get;set;}
公共字符串Pix_格式{get;set;}
公共双Fps{get;set;}
公共双流{get;set;}
公共整数高度{get;set;}
}
公共类HeywatchVideoSpecsaudo
{
公共int通道{get;set;}
公共整数采样率{get;set;}
公共字符串编解码器{get;set;}
公共布尔同步{get;set;}
公共整数比特率{get;set;}
公共int流{get;set;}
}

我做错了什么?

我的问题解决了。我的.Net类与Json对象不完全匹配。(两者都在问题中)


当他们匹配时,这个错误消失了

什么是“无法”呢?您会遇到什么错误?您忘记提供有关正在使用的JSON序列化程序以及实际执行此序列化的代码的信息。你还忘了说问题到底是什么。你说的都是
无法
,但你能再精确一点吗?你有例外吗?是否正在创建目标对象,但某些属性未反序列化?如果是,哪一个?至少,你需要指出a)你正在尝试做什么b)到目前为止你已经尝试了什么c)你的尝试有什么不起作用为什么这个标记为JavaScript?这似乎与此无关……看来你在编辑问题时做得不错。代码示例足以重新创建问题。
public class HeyWatchVideo
{
    public DateTime Created_At { get; set; }
    public string Title { get; set; }
    public Dictionary<string, string> Specs { get; set; }
    public DateTime Updated_At { get; set; }
    public int Id { get; set; }
    public string Filename { get; set; }
    public string Link { get; set; }
    public string Url { get; set; }
}

public class HeyWatchVideoSpecs
{
    public HeyWatchVideoSpecsAudio Audio { get; set; }
    public HeyWatchVideoSpecsVideo Video { get; set; }
    public string Thumb { get; set; }
    public string Mime_type { get; set; }
    public int Size { get; set; }
}

public class HeyWatchVideoSpecsVideo
{
    public int Rotation { get; set; }
    public double Aspect { get; set; }
    public string Container { get; set; }
    public string Codec { get; set; }
    public int Length { get; set; }
    public int Width { get; set; }
    public int Bitrate { get; set; }
    public string Pix_format { get; set; }
    public double Fps { get; set; }
    public double Stream { get; set; }
    public int Height { get; set; }
}

public class HeyWatchVideoSpecsAudio
{
    public int Channels { get; set; }
    public int Sample_rate { get; set; }
    public string Codec { get; set; }
    public bool Synched { get; set; }
    public int Bitrate { get; set; }
    public int Stream { get; set; }
}