开发者

LINQPad 4 doesn't know about HttpUtililty - how to resolve?

I recently started using LINQPad to test bits and pieces and its a great time saver.

However, some开发者_开发问答times it gives me some errors with minor things.

when I want to test this:

HttpUtility.UrlPathEncode("Make sure");

I get this error: The name 'HttpUtility' does not exist in the current context.

Is there a way to get it to recognize basic stuff like HttpUtility?


I just tried writing:

System.Web.HttpUtility.UrlPathEncode("Make sure")

and I am shown this: The type or namespace name 'HttpUtility' does not exist in the namespace 'System.Web'


You need to a reference System.Web.dll. Press F4 (References) and add a reference to that DLL.

Or, if you have an autocompletion license, just type your original query:

HttpUtility.UrlPathEncode("Make sure");

and open the smart-tag that automatically appears. It will present a menu option to add the reference to System.Web.dll and import the System.Web namespace in a one-fell-click!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜