当前上下文中不存在 HttpUtility [英] HttpUtility does not exist in the current context

查看:56
本文介绍了当前上下文中不存在 HttpUtility的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在编译 C# 应用程序时收到此错误.看起来是个小错误,但我无法解决.

I get this error when compiling a C# application. Looks like a trivial error, but I can't get around it.

我的设置是 Windows 7 64 位.Visual-Studio 2010 C# express B2Rel.

My setup is Windows 7 64 bit. Visual-Studio 2010 C# express B2Rel.

我添加了对位于 C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.0 的 System.Web.dll 的引用,但它有一个黄色感叹号,我仍然收到上述错误.我也有 using System.Web 声明.

I added a reference to System.Web.dll located at C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.0, but it has a yellow exclamation symbol and I still get the above error. I also have the using System.Web declaration.

我做错了什么?

更新: 在得到指向我根本原因的提示答案后,我在 Google 中搜索了一下,它指出 System.Web.dll 适用于完整框架.我没有找到这样的参考.
对于像我这样的新手,this 博客很好地总结了框架(客户端和完整)之间的区别.我找不到说明客户端框架中是否支持某个 Dll 的地方.我猜 Visual Studio 中的感叹号应该是第一个信号...

Update: After getting the prompt answer pointing me at the root cause, I searched a bit in Google to where it states that System.Web.dll is for the full framework. I did not find such a reference.
For newbies like me, this blog summarizes the difference between the frameworks (client and full) nicely. I could not find a spot that says whether a certain Dll is supported in the client framework or not. I guess the exclamation mark in Visual Studio should be the first signal...

推荐答案

您可能针对的是客户端配置文件,其中 System.Web.dll 不可用.

You're probably targeting the Client Profile, in which System.Web.dll is not available.

您可以在项目的属性中定位完整的框架.

You can target the full framework in project's Properties.

这篇关于当前上下文中不存在 HttpUtility的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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