简体   繁体   English

在 VS2015 中找不到 System.Web.Helpers

[英]System.Web.Helpers not found in VS2015

I'm trying to add some JSON parsing to the C# code in VS2015 but I can't find:我正在尝试向 VS2015 中的 C# 代码添加一些 JSON 解析,但我找不到:

System.Web.Helpers系统.Web.Helpers

as the MS documentation suggests.正如 MS 文档所建议的那样。 I've looked at other people's questions of a similar nature (almost all on earlier versions) and the answers all say to add it in the Assemblies / Framework dialog.我看过其他人的类似问题(几乎都是早期版本),答案都说要将其添加到“程序集/框架”对话框中。

The problem is it doesn't appear in that dialog, nor do many of the other things I see people talking about.问题是它没有出现在那个对话框中,我看到人们谈论的许多其他事情也没有出现。

I would really appreciate any help on fixing this.我真的很感激解决这个问题的任何帮助。

Here is the list I have access to:这是我可以访问的列表:

程序集 - VS2015 的框架列表 - C#

Edit: Added the Extensions window as well编辑:还添加了扩展窗口

VS2015 程序集 - 扩展窗口

This question is a bit old but here's a simple solution - Microsoft seemed to just move this library to a Nuget package called " microsoft-web-helpers ". 这个问题有点陈旧,但这是一个简单的解决方案 - 微软似乎只是将这个库移动到名为“ microsoft-web-helpers ”的Nuget包中。 Installing that package seems to be equivalent to having the assembly. 安装该软件包似乎等同于具有该程序集。

You cannot find it because of the simple fact that's not part of the Framework assemblies (what you are looking at). 您无法找到它,因为它不是Framework程序集的一部分(您正在查看的内容)。

It's part of the Extensions assemblies, and, as posted here , you will find it under "Extensions" in the left-hand side of the dialog. 它是Extensions程序集的一部分,如此处所示 ,您可以在对话框左侧的“Extensions”下找到它。

看这个

Old question but might still help someone. 老问题,但可能仍然可以帮助某人。

You must install MVC 3 in order to have the System.Web.Helpers Extension on VS2015. 您必须安装MVC 3才能在VS2015上安装System.Web.Helpers Extension。

link to download: https://www.microsoft.com/en-us/download/details.aspx?id=1491 链接下载: https//www.microsoft.com/en-us/download/details.aspx?id = 1491

I was wanting to work with JSON as well in an ASP.Net project using VS2015. 我想在使用VS2015的ASP.Net项目中使用JSON。 I ended up here trying to find answers. 我最终在这里试图找到答案。 Right about the time I finished reading the other answers on this post I noticed my project already had a reference to Newtonsoft.Json . 就在我读完这篇文章的其他答案的时候,我注意到我的项目已经引用了Newtonsoft.Json Never heard of it before so I looked it up; 从来没有听说过,所以我查了一下; I'm glad I did. 我很高兴我做到了。

It was literally a one liner to Serialize a List<String> to JSON . 它实际上是一个将List<String>序列化为JSON单行程序。 You can pass in an Object so you should be able to serialize most any Object within reason. 您可以传入一个Object这样您就可以在合理范围内序列化大多数任何对象。

Ultimately I didn't need to install MVC3 or reference System.Web.Helpers 最终我不需要安装MVC3或参考System.Web.Helpers

Hope this helps! 希望这可以帮助!

在此输入图像描述 NewtonSoft Serializing and Deserializing JSON NewtonSoft序列化和反序列化JSON

我偶然发现了同样的问题并通过添加 NuGet Package -> Microsoft.AspNet.WebPages 修复了它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM