'HttpUtility' is not a member of 'Web' in console application VS2010.

Jun 18, 2010 Posted by Lara Kannan
Today I started my first console application developmentin VS 2010.

After I added the below code
System.Web.HttpUtility.UrlEncode(item)

and build the application, the system throws the error message like
Error message: 'HttpUtility' is not a member of 'Web'.

This error message suggests to add a reference to System.Web. When I look into it over the reference list, its was not there. I only have "System.Web.ApplicationServices" and "System.Web.Services". I dont know why its not there in the list?

Then my friend said, 'target framework may be different'. After that I checked the target framework, its was .NET Framework 4 Client Profile. Then I changed it as .NET Framework 4. Now my code works fine.

Hope this ll help you.

Share
  1. Anonymous

    If you want to change the target framework, here are the instructions:

    http://msdn.microsoft.com/en-us/library/bb398202.aspx

Post a Comment