Accessing ASP.NET Development Server from another pc on the network

Paul Knopf picture Paul Knopf · Nov 13, 2009 · Viewed 42k times · Source

I would like to test my web app in other browsers. I have installed Virtual PC to do just that. the ASP.NET development server does not allow remote connections so the virtual pc (another computer on the network) cannot access the website.

I found this post that was started but there was no solution.

I understand that using localhost will not work. I heard about using the machines ip, but how do I get that correct ip? Look at my lynksys router admin?

If I were to get as far as getting my IP, im sure that the asp.net dev server does not allow remote connections. How do I enable it to do so?

Answer

splattne picture splattne · Oct 29, 2010

The answer is: no(*). You cannot access the ASP.NET Development Server on one machine from another, even if you open the Windows firewall TCP port.

From the MSDN article "Web Servers in Visual Web Developer":

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.

(*) You'll have to run your site from your locally installed IIS... or do the nice hack using some freeware described in this blog post:

iPhone Accessing the Visual Studio ASP.NET Development Server

Use SPI Port Forward to accept the device connections do the following:

Set "Local port" to the port number the device will connect on, I usually use 8080 out of habit
Set "Remote host" to localhost
Set "Remote port" to the ASP.NET Dev Server Port

Click the "Activate" button to start accepting connections

(note: make sure you've started the program with admin rights)