框架3.5中的当前上下文中不存在httputability [英] httputility does not exist in current context in framework 3.5
问题描述
我试图用 HttpUtility.UrlEncode
在我的的SharePoint
项目中的框架3.5
,但它不承认它。简单地说:
I'm trying to use HttpUtility.UrlEncode
in my sharepoint
project in the framework 3.5
but it doesn't recognise it. Simply saying :
HttpUtility在目前的情况下不存在
HttpUtility does not exist in current context
我叫的System.Web
,但它仍然不承认没有在HTTP对象!
I called System.Web
but it still doesn't recognise none of the Http objects !
推荐答案
您需要添加一个引用的 System.Web.dll中的
You need to add a reference to System.Web.dll
一个的使用的System.Web 的没有上述参考不会单独是足够的。
A using System.Web without the above reference will not suffice alone.
不幸的是,在 System.Web.dll中的不能被引用针对.NET框架的客户端配置文件版本的项目。所以看你的项目属性,并确保它的目标是.NET框架3.5,而不是.NET Framework 3.5的客户端配置文件。
Unfortunately, the System.Web.dll cannot be referenced in a project that targets a Client Profile version of the .Net framework. So look at your project properties and make sure it targets ".NET Framework 3.5" and not ".NET Framework 3.5 Client Profile".
这篇关于框架3.5中的当前上下文中不存在httputability的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!