Yesterday I would like to install Siverlight add-on to Visual Studio 2008 to make some Silverlight application. The installation of the Add-on worked perfectly. I had no errors or something like that. When I created a blank Silverlight, compiled it, and opened it in a browser to see if it works… then a stupid error comes. In IE it is “Page cannot be displayed” and in FF “Firefox can’t establish a connection to the server”.
As you know to test or run ASP.NET Web applications, you need a Web server. The production Web server for Microsoft operating systems is IIS, which includes a Web server, File Transfer Protocol (FTP) server, Simple Mail Transfer Protocol (SMTP) virtual e-mail server, and other facilities.
If you cannot or do not want to use IIS as your Web server, you can still test your ASP.NET pages by using the ASP.NET Development Server. The ASP.NET Development Server, which is included with Visual Studio, is a Web server that runs locally on Windows operating systems, including Windows XP Home Edition. It is specifically built to serve, or run, ASP.NET Web pages under the local host scenario (browsing from the same computer as the Web server). In other words, the ASP.NET Development Server will serve pages to browser requests on the local computer. It will not serve pages to another computer. Additionally, it will not serve files that are outside of the application scope.
Let’s go back to the error, as I see this error I know that ASP.NET Web server can not map the localhost plus port number into the right URL. But I did not know how to fix it. So I start a search in Internet, after 30 Minutes of hard searching I found that when I use 127.0.0.1 instead of localhost, it will run. So the problem is because of IPV6 supports of ASP.NET Development Server. To disable IPV6 so that ASP.NET Development Server runs, we can do as below.
1. Go to c:\Windows\System32\Drivers\etc\.
2. Edit file hosts. Put a ‘#’ before the rows “::1 localhost”.
3. Save it.
Compile your project again. It will run.
Another helpful links: