Why isn't HttpUtility class being recognised?

2019-03-25 05:03发布

问题:

I am trying to call the static HttpUtility.UrlEncode in my VB.NET project, but the IDE is not recognising the class saying that it is not declared.

I have imported the namespaces System.Net and System.Web to the project.

I also have the following at the top of the file:

Imports System.Net
Imports System.Web

What am I doing wrong?

回答1:

Add a reference to System.Web.dll to your project.