ASP .NET served on local ip not localhost

Viewed 52

On a ASP .NET project, as I needed to see my local work on my phones, I wanted to switch from "localhost" to local ip.

I changed applicationhost.config : after the existing localhost nodes, adding :

<binding protocol="http" bindingInformation="*:64645:192.168.XXXX" />
<binding protocol="https" bindingInformation="*:44314:192.168.XXXX" />

But nothing works, when building and running the project applicationhost.config is overwritten, those two lines disappear and back to initial state, indeed runs localhost:44314

I use JetBrain IDE

If you have any clue, merci !!!

1 Answers

From your description, I assume that you have hosted your Asp.Net site on the IIS web server and you would like to access the site in your local network using a mobile device. (Please correct me if I misunderstood something).

In the case mentioned above, you could refer to the steps below.

  1. Open the IIS, and select your site. Go to the bindings.

  2. Add new HTTP binding. Keep the Hostname empty. Select the desired port. Keep the IP address All unassigned.

enter image description here

  1. Go to Firewall settings. Add a new inbound rule. Add the port that you are using for your site. Complete the steps by clicking the Next button.

  2. Restart your site in the IIS.

  3. Now you could access the site using [IP Address]:[Port Number] within your network using any device.

By referring to the same steps you could configure the HTTPS binding.

Related