在添加参考中找不到System.Web. [英] Can not find System.Web in add reference.

查看:76
本文介绍了在添加参考中找不到System.Web.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我尝试在

I am try to use the method in System.Web.HttpUtility.UrlEncode but intellisense only shows three classes under System.Web. 

在线搜索后,我发现我需要添加对System.Web.dll的引用,因为我正在制作Windows应用程序.

我已经看过与我的问题完全相同的问题,但是该解决方案不起作用.http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/053edd7e-b4c2-4602-98fe-f4e3274c81be

I have looked at this question which is exactly the same thing as mine but that solution is not working. http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/053edd7e-b4c2-4602-98fe-f4e3274c81be

在解决方案中发布的屏幕截图中,选择了System.Web,但是当我添加参考时,找不到System.Web

In the screen shot posted in the solution, System.Web is selected but when I go to add reference I can't find System.Web 

 

 

 

a

因此转到浏览"标签下,并添加了对

So went under browse tab and added a reference to 

C:\ Program Files(x86)\参考程序集\ Microsoft \ Framework \ .NETFramework \ v4.0 \ System.Web

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web

但是如图中所示,System.Web的显示带有黄色警告(没有工具提示),并且仍无法解决问题.我仍然无法引用System.Web.

but as you can see in the picture, System.Web is showing with a yellow warning (without a tooltip) and It has still not resolved the problem. I am still unable to reference System.Web.HttpUtility. Do I need to add anything in the code to gain access to the reference? I added "Using System.Web" but thats only to save typing (if it was working :P)

我正在使用Microsoft Visual C#2010 Express.

推荐答案

在我看来,发生这种情况是因为您已将Windows应用程序定位到.net Framework 4.0

Seems to me this happens because you have targeted the windows application to .net framework 4.0

但这不是借口.

暂时可以通过选择框架3.5尝试创建Windows窗体应用程序并将引用添加到System.Web.

For time being can you just try creating a Windows Forms Application by selecting framework 3.5 and add the reference to System.Web.

同时让我进一步研究为什么它没有显示在4.0项目的添加引用选项卡中.

Meanwhile let me do further investigation of why its not showing in the add reference tab of 4.0 project.


这篇关于在添加参考中找不到System.Web.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆