我开发了一个WinForm应用程序,目标框架设置为.net 4.0,现在我希望添加到一个项目,它的目标框架设置为.net 4.5.在我将4.0 WinForm应用程序添加到我的4.5项目后,我不断在我的HttpUtility对象上收到错误.
data += "&batch_data=" + HttpUtility.UrlEncode(batch, System.Text.Encoding.GetEncoding("ISO-8859-1"));
Run Code Online (Sandbox Code Playgroud)
"当前上下文中不存在名称'HttpUtility'"
我确实包含了HttpUtility所在的System.Web命名空间.
Visual Studio错误:
Run Code Online (Sandbox Code Playgroud)CS0234 The type or namespace name 'HttpUtility' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)