2013-04-24 73 views
0

我在.NET 3.5HttpUtility.UrlEncode方法不解决

HttpUtility.UrlEncode("", new UTF8Encoding()).Replace('+', ' '); 

后就正常使用此代码,但是我已经在.NET 4.0编译了该项目,它是给我这个错误: "The name 'HttpUtility' does not exist in the current context."

我加了System.WebSystem.Web.Extensions参考文献。这还没有解决enter image description here这个错误。

+2

这类似于这样的问题http://stackoverflow.com/questions/15020802/httputility-does-not-exist-in-current-context-in-framework- 3-5,请确保你的目标是完整的框架,而不是客户端配置文件 – 2013-04-24 08:05:29

回答

3

更改目标框架形式.Net Framework 4 Client Profile.Net Framework 4

+0

如果我安装.net 4.5它的工作原理? – gasroot 2013-04-24 08:08:13

+1

@Ammaedragas是..... – I4V 2013-04-24 08:11:44

+0

问题仍然存在我正在使用vs 2010 – gasroot 2013-04-24 08:41:35