[英]Error when creating ASP.NET website in Visual Studio
I'm trying to learn ASP.NET. 我正在尝试学习ASP.NET。 I open Visual Studio (this happens in both 2008 and 2010) and creating a new ASP.NET website using .NET 3.5. 我打开Visual Studio(在2008年和2010年都会发生这种情况),然后使用.NET 3.5创建一个新的ASP.NET网站。 When I attempt to run the website, a FireFox page opens up and tells me that it can't establish a connection to the server (localhost:####). 当我尝试运行网站时,FireFox页面打开,并告诉我它无法建立与服务器的连接(localhost:####)。 There's no helpful error message, just "cannot connect." 没有有用的错误消息,只是“无法连接”。 What could be causing this? 是什么原因造成的?
If you select your website in Visual Studio, you can set 'Use dynamic port' to false. 如果在Visual Studio中选择网站,则可以将“使用动态端口”设置为false。 Than you can configure to use a port which your firewall doesn't prohibit access to. 比您可以配置为使用防火墙不禁止访问的端口。 (often 8080 is chosen, as 80 is already in use). (通常选择8080,因为80已经在使用中)。
To be sure you port is open, configure your firewall to let your application have access to that port. 为确保端口是开放的,请配置防火墙以使您的应用程序可以访问该端口。 Completely shutting down your firewall is not what we are recommending I believe. 我认为,完全关闭防火墙不是我们所建议的。
By the way, if you are new to Visual studio and asp.net and creating websites, I recommend, depending on what you way want to do look into the difference of asp.net website and asp.net web application. 顺便说一句,如果您不熟悉Visual Studio和asp.net并创建网站,我建议您根据自己想做的方式来研究asp.net网站和asp.net Web应用程序的区别。 (asp.net web application is only available in the payed versions though I believe...) (尽管我相信,asp.net Web应用程序仅在付费版本中可用...)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.