- Running in Visual Studio 2017
- Running an application on port 8888
- Url used to access the application is http://localhost:8888
If you want to access the web site using http://somenamehere:8888 you can do this by doing the following.
- Open your .vs/config/applicationhost.config file in a text editor
- Find the binding for your application.
<binding protocol="http" bindingInformation="*:8888:localhost" />
- In the same <bindings> section, add another <binding>
<binding protocol="http" bindingInformation="*:8888:" />
- Optional: If you are using https you will need to do the same. The key is that you match the ports.
You should be able to launch your web site in Visual Studio (Control-F5, etc). This will bring it up as it always have.
Now you need to hack your dns so that it can resolve your new made up hostname. In this example, it is somenamehere. The easiest way to do this is to open up your hosts file (C:\Windows\System32\drivers\etc\hosts) in a text editor and add the following line to the bottom of it.
You should now be able to ping that hostname and see that 127.0.0.1 is responding.
Now open up the browser and go to http://somenamehere:8888 and you should get your application again.
NOTE: If VS2017 gives you any issues, it may be helpful to run it as administrator.