0

I used this Code in .net 3.5

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

which worked fine, but I have compiled the project under .NET 4.0 and it is giving me this error: "The name 'HttpUtility' does not exist in the current context.".

I added both System.Web and System.Web.Extensions references. This has not resolvedenter image description here this error.

Maryam Arshi
  • 1,974
  • 1
  • 19
  • 33
gasroot
  • 515
  • 3
  • 15
  • 2
    This looks similar to this issue http://stackoverflow.com/questions/15020802/httputility-does-not-exist-in-current-context-in-framework-3-5, make sure you are targeting the full Framework and not client profile – Steve Newstead Apr 24 '13 at 08:05

1 Answers1

3

Change target framework form .Net Framework 4 Client Profile to .Net Framework 4

I4V
  • 34,891
  • 6
  • 67
  • 79