1

I'm running a ASP.NET on my pc and I would like to access to that app from another pc on the same network. I've tried to reach the app writing the URI of my pc on the network followed by the port number as below: "192.168.X.X:49223/"

But it shows me an 400 error saying that it's an invalid hostname... Is there something to do with my windows firewall or in IIS to allow access from another PC ?

Thanks for your help.

Hubert Solecki
  • 2,611
  • 5
  • 31
  • 63
  • You can do it by using `IIS Express`. [Here](http://stackoverflow.com/questions/5433786/configure-iis-express-for-external-access-to-vs2010-project) you can find the answer on how to do it. `applicationhost.config` file is located at `%USERPROFILE%\Documents\IISExpress\config` – th1rdey3 Dec 22 '13 at 05:37

3 Answers3

2

You may need to an exception in Windows Firewall.

Control Panel > Windows Firewall > Advanced Settings > Inbound/Outbound rules.

Add a new rule to both, specifying your port number and a generic name to identify its purpose.

Cody Hicks
  • 420
  • 9
  • 24
  • Thanks for the answer, I've just done that. The rule that I've created allows all external connexions to any port of my PC where I'm running the app but still the same error. – Hubert Solecki Dec 22 '13 at 05:22
1

Install IIS server on your machine, then deploy your application on that IIS server. Refer this for Deployment assistance

To run the application on IIS instead of ASP.Net dev server you need to

  1. Right click on solution in VS
  2. Click on Start Options..
  3. In Server section, Select "Use Custom Server" and then provide the URL of the application you have added earlier on IIS

Then you can easily access your website from any other machine on the same network.

AbdulRahman Ansari
  • 3,007
  • 1
  • 21
  • 29
0

Is it hosted in iis, or are you running it through Visual Studio. The funny port number (49223) tells me it's the latter.

When you run a VS project, the dev server is designd to only allow local conconnections. If you connect from a network it gets blocked by design. Their is no config around it.

What I do as a hack is run a reverse proxy like Nginx. It's a free download. Run it on your dev machine. You can tell it to listen on a port (eg 88) and then redirect tge traffic to port 49223. Give your mate the same url as before but replace the port with 88

Nb make sure your port 88 is open as per codemans answer

An example of the nginx config would be https://gist.github.com/ekinertac/5524389

This then tricks VS into thinking it came from your local machine.

Crudler
  • 2,194
  • 3
  • 30
  • 57