方案一:
如果是WebAPI,可以加入全局设置:
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new DefaultContractResolver() { IgnoreSerializableAttribute = true };
方案二:
Remove
[Serializable]
from your class 或者Add [DataContract] 、
[DataMember]
to your class