Another thing you can do is use the Mono.HttpUtility nuget package, and use the namespace Mono.Web instead of System.Web.
Mono.Web
System.Web