命名空间 System 中不存在 Json

问题描述:

在本教程中:http://www.asp.net/web-api/videos/getting-started/custom-validation Jon 使用

In this tutorial: http://www.asp.net/web-api/videos/getting-started/custom-validation Jon uses

dynamic error = new JsonObject();

using System.Json;

我猜这里是 JsonObject:http://msdn.microsoft.com/en-us/library/system.json.jsonobject(v=vs.110).aspx 位于:

I guess it's the JsonObject here: http://msdn.microsoft.com/en-us/library/system.json.jsonobject(v=vs.110).aspx located in:

  • 命名空间:System.Json
  • 程序集:System.Runtime.Serialization(在 System.Runtime.Serialization.dll 中)

我已经添加了 System.Runtime.Serialization 一个引用,但仍然找不到 System.Json.

I've added System.Runtime.Serialization a reference but still cannot find System.Json.

我是否读错了 Microsoft 文档?(我使用的是 .NET 4.5)

Am I reading the Microsoft docs wrong? (I'm using .NET 4.5)

试试这个:

PM> Install-Package System.Json -Version 4.0.20126.16343

每个:http://nuget.org/packages/System.Json

成功了!

如果您对如何添加输入 nuget 代码有疑问,请点击以下链接:http://docs.nuget.org/docs/start-here/using-the-package-manager-console

If you have questions on how to add enter nuget code, please follow the link below: http://docs.nuget.org/docs/start-here/using-the-package-manager-console