[英]Where can I find the assembly System.Web.Extensions dll?
I'm messing around with some JSON and I'm trying to use the JavascriptSeralizer Class but I cannot for the love of god find a link to find where to add the assembly to my project.我正在处理一些 JSON 并且我正在尝试使用 JavascriptSeralizer 类,但我无法为上帝的爱找到一个链接来找到将程序集添加到我的项目的位置。 Someone help please!有人请帮忙!
Update I'm using .NET 4.0 and its not in the .Net tab when you right click on references -> add reference in the solution explorer of Visual C# 2010.更新我正在使用 .NET 4.0,当您右键单击引用时,它不在 .Net 选项卡中 -> 在 Visual C# 2010 的解决方案资源管理器中添加引用。
I had this problem myself.我自己也有这个问题。 Most of the information I could find online was related to people having this problem with an ASP.NET web application.我可以在网上找到的大部分信息都与在 ASP.NET Web 应用程序中遇到此问题的人有关。 I was creating a Win Forms stand alone app so most of the advice wasn't helpful for me.我正在创建一个 Win Forms 独立应用程序,所以大部分建议对我没有帮助。
Turns out that the problem was that my project was set to use the ".NET 4 Framework Client Profile" as the target framework and the System.Web.Extensions reference was not in the list for adding.原来问题是我的项目设置为使用“.NET 4 Framework Client Profile”作为目标框架,而 System.Web.Extensions 引用不在添加列表中。 I changed the target to ".NET 4 Framework" and then the reference was available by the normal methods.我将目标更改为“.NET 4 Framework”,然后可以通过正常方法获得参考。
Here is what worked for me step by step:这是一步一步对我有用的方法:
EDIT:编辑:
The info below is only applicable to VS2008 and the 3.5 framework.以下信息仅适用于 VS2008 和 3.5 框架。 VS2010 has a new registry location. VS2010 有一个新的注册表位置。 Further details can be found on MSDN: How to Add or Remove References in Visual Studio .更多详细信息可以在 MSDN 上找到:如何在 Visual Studio 中添加或删除引用。
ORIGINAL原版
It should be listed in the .NET tab of the Add Reference dialog.它应该列在“添加引用”对话框的 .NET 选项卡中。 Assemblies that appear there have paths in registry keys under:出现在那里的程序集在以下注册表项中有路径:
HKLM\Software\Microsoft\.NETFramework\AssemblyFolders\
I have a key there named Microsoft .NET Framework 3.5 Reference Assemblies with a string value of:我有一个名为Microsoft .NET Framework 3.5 Reference Assemblies的密钥,其字符串值为:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\
Navigating there I can see the actual System.Web.Extensions dll.在那里导航我可以看到实际的System.Web.Extensions dll。
EDIT:编辑:
I found my .NET 4.0 version in:我在以下位置找到了我的 .NET 4.0 版本:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Extensions.dll
I'm running Win 7 64 bit, so if you're on a 32 bit OS drop the (x86).我正在运行 Win 7 64 位,因此如果您使用的是 32 位操作系统,请删除 (x86)。
The assembly was introduced with .NET 3.5 and is in the GAC.该程序集是在 .NET 3.5 中引入的,并且在 GAC 中。
Simply add a .NET reference to your project.只需向您的项目添加一个 .NET 引用。
Project -> Right Click References
-> Select .NET
tab -> System.Web.Extensions项目 -> 右键单击References
-> 选择.NET
选项卡 -> System.Web.Extensions
If it is not there, you need to install .NET 3.5 or 4.0.如果不存在,则需要安装 .NET 3.5 或 4.0。
Your project is mostly likely targetting .NET Framework 4 Client Profile.您的项目很可能以 .NET Framework 4 Client Profile 为目标。 Check the application tab in your project properties.检查项目属性中的应用程序选项卡。
This question has a good answer on the different versions: Target framework, what does ".NET Framework ... Client Profile" mean?这个问题对不同版本有很好的回答: 目标框架,“.NET Framework ... Client Profile”是什么意思?
I had this issue when converting an older project to use a new version of Visual Studio.在将旧项目转换为使用新版本的 Visual Studio 时,我遇到了这个问题。 Upon conversion, the project target framework was set to 2.0转换后,项目目标框架设置为 2.0
I was able to solve this issue by changing the target framework to be 3.5.我能够通过将目标框架更改为 3.5 来解决这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.