Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot connect ASP.NET development server (VS2010) via IP address

Visual Studio 2010 / ASP.NET project / ASP.NET Development server

I can run and debug my VS2010 ASP.NET project from my development computer (where VS2010 runs). URL: http://localhost:port/MyApp.htm works fine.

Since I want to test the application from an IPad as well, I need to call the application with its IP address such as http://192.168.0.132:port/MyApp.htm

To my surprise this does not work, neither from the IPad, nor from the dev. computer itself. It is not a matter of connectivity, the address is correct / ping is possible.

(Note that I have no IIS installed on this machine, actually the ASP.NET application is plain HTML+JS, I use VS2010 just for debugging.)

Any workaround for this?

like image 598
Horst Walter Avatar asked Jul 13 '11 17:07

Horst Walter


3 Answers

The Visual Studio Development Server will only serve pages to the local machine:

From Web Servers in Visual Web Developer:

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 Web Developer, 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. The ASP.NET Development Server provides an efficient way to test pages locally before you publish the pages to a production server running IIS.

The ASP.NET Development Server only accepts authenticated requests on the local computer. This requires that the server can support NTLM or Basic authentication.

If you wish to test pages remotely you will need to use IIS or IIS Express.

like image 57
Martin Avatar answered Oct 22 '22 14:10

Martin


I ran into this same problem and found a great solution. You can use SPI Port Forwarder (or a similar tool) to forward outside requests to the VS development web server. It works great and you can turn it on and off as needed.

Check out the info here: Accessing the Visual Studio ASP.NET Development Server from iPhone & iPad

like image 45
Matt Penner Avatar answered Oct 22 '22 15:10

Matt Penner


http://opensource.oxyva.nl/simple-development-proxy seems to work around Visual Studio Express 2012 for Web not allowing connections from other devices like iPhone, iPad etc. which result in "HTTP Error 400: Bad Request - Invalid Hostname"

There seems to be another solution as described in: visual web developer Web service on debug HTTP/1.1 400 Bad Request

like image 40
Bas van Dijk Avatar answered Oct 22 '22 15:10

Bas van Dijk