0

In the following code:

for (int line = 0; line < CHUNKSTOBEFOUND; line++) {
    nvc.Add ("search", System.Web.HttpUtility.UrlEncode (stringsToSearchFor[line]));
}

I get told namespace name HttpUtility does not exist. http://msdn.microsoft.com/en-us/library/system.web.httputility.aspx seems to indicate I should use System.Web. I've tried using that, but I STILL get the error. Is there something else I'm supposed to include or use?

2 Answers 2

2

As competent_said, you are probably targeting the Client Profile in your project, in which System.Web.dll is not available. You can target the full framework in Project Properties to get it back working.

Another possible cause could be that you are not referencing System.Web library. To do so:

  1. Right click the "Reference" in the Solution Explorer.
  2. Choose "Add Reference"
  3. Check the ".NET" tab is selected.
  4. Search for, and add "System.Web".

Maybe you are just missing an using directive using System.Web; on the top of your source file.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much, both of you! I needed to do both as it turns out!
1

You are most likely using the Client Profile version of the .Net framework. You need to open your project properties and change the framework version to the full version.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.