The HttpUtility class is a part of System.Web in Visual Studio and should be available in .NET 4.0. If you include this library in your application and an error is being generated, check the properties of the project. In the Application tab, the Target framework should not be a Client Profile, but the full framework, i.e. .NET Framework 4 (see image below).

Setting Target Framework in project properties.

If this doesn’t fix the error, then add System.Web as a reference to your project (see image below).

Adding System.Web to references.

The error should be corrected after these changes are applied.

Print Friendly, PDF & Email
Translate »