1.打开 程序管理器控制台 输入 PM> install-package newtonsoft.json
2.查看bin文件中是否有 newtonsoft.json.dll文件
3.在Web.config 中添加
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime>
5.重新编译后运行
本文介绍了如何使用程序管理器安装Newtonsoft.Json包,并详细解释了如何在项目的Web.config文件中进行必要的配置以确保正确使用该JSON处理库。此外,还提供了检查bin文件夹下是否存在Newtonsoft.Json.dll文件的方法。
876

被折叠的 条评论
为什么被折叠?



