Why is System.Web.HttpUtility.UrlEncode giving namespace name doesn't exist in Visual C# 2008?

前端 未结 4 1316

I\'m trying to encode a URL using the HttpUtility.UrlEncode() method, why am I getting

The type or namespace name \'HttpUtility\' does not e

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-02 11:27

    Just in case anyone stumbles across this, is running VS 2010 and cannot find System.Web in the available references...

    Right click on the project and select Properties, if the Target Framework is set to ".Net Framework 4 Client" then change it to ".Net Framework 4".

    But beware this will close, reopen and rebuild your project (also if you have a web service references these will need to be refreshed)

提交回复
热议问题