命名空间“System"中不存在类型或命名空间名称“Json"(您是否缺少程序集引用?) [英] The type or namespace name 'Json' does not exist in the namespace 'System' (are you missing an assembly reference?)

查看:164
本文介绍了命名空间“System"中不存在类型或命名空间名称“Json"(您是否缺少程序集引用?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 .NET Framework 4.5,但遇到了这个问题.命名空间System"中不存在类型或命名空间Json"

I am using .NET Framework 4.5 and I'm having this issue. The type or namespace 'Json' does not exist in the namespace 'System'

所以,我尝试安装包 System.Json -Version 4.0.20126.16343,但后来我遇到了这个问题.

So, I tried to Install-Package System.Json -Version 4.0.20126.16343 but I had this issue afterwards.

类型System.Uri"是在未引用的程序集中定义的.您必须添加对程序集System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"的引用

The type 'System.Uri' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

来源:https://www.nuget.org/packages/System.Json

任何想法将不胜感激!

推荐答案

该软件包已停产,不应再使用.

That package is discontinued and shouldn't be used any more.

如果您有控制台应用程序,我可以推荐两个选项:

If you have a console application, I could recommend two options:

  • JSON.NET. Not a part of the .NET Framework itself, but much faster than Microsofts implementation;
  • Microsofts implementation of the JavaScriptSerializer.

两者都能够读取和写入 JSON.我发现 JSON.NET 库更易于使用且功能更完整.

Both are capable of reading and writing JSON. I find the JSON.NET library easier to use and more feature complete.

这篇关于命名空间“System"中不存在类型或命名空间名称“Json"(您是否缺少程序集引用?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆