简体   繁体   English

我在哪里可以找到程序集 System.Web.Extensions dll?

[英]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:这是一步一步对我有用的方法:

  1. Right Click you project Select Properties右键单击您的项目选择属性
  2. Change your Target Framework to ".NET Framework 4"将目标框架更改为“.NET Framework 4”
  3. Do whatever you need to do to save the changes and close the preferences tab做任何你需要做的事情来保存更改并关闭首选项选项卡
  4. Right click on the References item in your Solution Explorer右键单击解决方案资源管理器中的引用项
  5. Choose Add Reference...选择添加参考...
  6. In the .NET tab, scroll down to System.Web.Extensions and add it.在 .NET 选项卡中,向下滚动到 System.Web.Extensions 并添加它。

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.

相关问题 无法添加System.Web.Extensions程序集作为参考 - can not add System.Web.Extensions Assembly as reference 无法解析System.Web.Extensions程序集 - System.Web.Extensions Assembly cannot be resolved 如何在Webconfig中找到System.Web.Extensions的正确引用? - How can I find the correct reference in the webconfig for System.Web.Extensions? 无法加载文件或程序集“ System.Web.Extensions” - Could not load file or assembly 'System.Web.Extensions' System.Web.Extensions的用途是什么? - What is System.Web.Extensions for? 为什么我不能在Console应用程序中引用System.Web.Extensions? - Why can't I reference System.Web.Extensions in a Console application? 无法使用system.web.extensions托管网站 - Cannot host website with system.web.extensions VS2010中2.0框架.net引用中缺少System.web.extensions引用dll? - System.web.extensions reference dll is missing from the 2.0 framework .net references in VS2010? 我是否需要web.config值配置 - >运行时 - > System.Web.Extensions的assemblyBinding? - Do I need the web.config values configuration -> runtime -> assemblyBinding for System.Web.Extensions? 在哪里可以找到安装了MVC 3的系统中的System.Web.MVC dll? - Where can I find System.Web.MVC dll in a system where MVC 3 is installed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM