Cannot find DataContractJsonSerializer from an Asp.Net Mvc application

大兔子大兔子 提交于 2019-12-04 10:48:41

问题


I can't get access to the DataContractJsonSerializer method from System.Runtime.Serialization.Json

If I do:

using System.Runtime.Serialization.Json;

I get an error...

How can I access this in my Asp.Net Mvc app so I can use the DataContractJsonSerializer method


回答1:


Make sure you've referenced the DLL where this type lives: System.ServiceModel.Web.dll




回答2:


Right Click in Project, Add Reference...

Search for System.Runtime.Serialization

Click Ok/Add



来源:https://stackoverflow.com/questions/1127264/cannot-find-datacontractjsonserializer-from-an-asp-net-mvc-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!