I’d like to use HttpUtility.UrlEncode in a console application, VB.NET, VS 2010 Beta 2.
System.Web.HttpUtility.UrlEncode(item)
Error message: ‘HttpUtility’ is not a member of ‘Web’.
In this question Anjisan suggests to add a reference to System.Web, as follows:
- In your solution explorer, right click on references
- Choose “add reference”
- In the “Add Reference” dialog box, use the .NET tab
- Scroll down to System.Web, select that, and hit ok
However, I don’t have a System.Web entry at that location.
System.Webis there, but seems Visual Studio doesn’t sort by name by default. You’ll need to clickComponent namecolumn to get that list sorted.I was able to run this code:
Just adding a
System.Webreference, withoutSystem.Web.Extensions.Also, You should replace your target framework from .NET Framework 4 Client Profile to .NET Framework 4; go to Project >> Properties… >> Application tab