Visual Studio ASP.NET Development Server – “Internet Explorer cannot display the webpage”

I like to work at home, and my set up at home is almost at good as work, but due to less distractions it can be better. When I created a TFS workspace for my home computer (was Vista, now Windows 7), I got the latest source, built it, and all was good… almost. It did not run. We are building an ASP.NET application and when running under the ASP.NET Development Server (WebDev.WebServer.exe) I would get sent to this error page, which told me nothing useful about why it was failing.

This was irritating, but didn’t really bother me because I could work around it quite quickly. I opened the Web properties of the ASP.NET Web Application project (right click the project, select Properties and then the Web tab on the left) and set it to run from the Local IIS (Internet Information Services) Web server. The only issue this had was I must run Visual Studio as an Administrator since I have User Account Control (UAC) enabled, and I don’t get Edit and Continue.

 

Today however, this won’t do. Today I want to create a new workspace on my home machine to work on multiple unrelated things at the same time. Multiple workspaces is a great productivity boost, from reproducing issues locally in an unchanged environment, to running units tests or other long running processes and working on something else while they are chugging away. I do not want to create multiple virtual directories in IIS, although I could. One of the things I like about the environments I have set up, is that they allow virtually no configuration on any PC you want to use, as long as you have Visual Studio with Team Explorer, you are ready to develop. And our rich wiki requires OneNote and that is all. Both enable also enable working offline and starting new developers or changing PCs is very easy. I thought it might be related to UAC or the firewall, but after a quick look around and I found ASP.NET Developer server not working which lead to IE won’t connect to asp.net server which had the solution. Opening up Notepad as Administrator (since I have UAC on) loading the C:\Windows\System32\drivers\etc\hosts file and commenting out the line ::1 localhost, restart only the browser instance that failed and all is working.

Now Visual Studio does not need to run as Administrator, I do not need to configure IIS, I can have Edit and Continue and multiple workspaces all running completely independently.

 

Advertisements