locked
Can't listen on anything but localhost (ASP MVC Framework IIS Express) RRS feed

  • Question

  • User382791461 posted

    I'm unable to get a .Net Framework MVC project to listen on anything except localhost.

    If I change

    <IISUrl>http://localhost:2319/</IISUrl>
    to

    <IISUrl>http://eadev:2319/</IISUrl>

    my project won't even load.

    I get the following error:


    > Creation of the virtual directory http://eadev:2319 failed with the error: Cannot create the Web site 'http://eadev:2319'. You must specify "localhost" for the server name.


    I've seen just tons of issues on this, and someone in my own company has this working, but I cannot get it to work. I actually set him up. And I still can't do this.

    I've tried

    netsh http add url=http://eadev:2319 users=everyone

    That just gives me access denied errors when I run it from the console, but it's still trying to load `localhost:2319`

    I deleted the `.vs` directory. I added entries to the `.vs/app/config/applicationhosts.config`

    I've added `eadev` to the hosts file.

    Also, one thing that used to work is that I downloaded nginx for Windows and setup a reverse proxy, but now it just says bad gateway. I even setup an ssh tunnel. I'm assuming now it's being picky about headers. I can access `http://localhost:2319`, but not nginx `proxy_pass http://localhost:2319` is now giving bad gateway, but it used to work. If I point the `proxy_pass` to `http://example.org` it works.

    Edit: I found out that nginx is resolving to `127.0.0.1` and IIS Express just won't respond.

    There are just so many answers to this and other people seem to have got it working, but I cannot.

    Saturday, August 8, 2020 3:01 AM

All replies

  • User-474980206 posted

    You need to update the iis express config bindings. See

    https://stackoverflow.com/questions/4709014/using-custom-domains-with-iis-express

    Saturday, August 8, 2020 3:40 PM
  • User382791461 posted

    @bruce,  I already tried that.  Sorry, when you try 100 things you're bound to miss one.

    I can't do that.  When I click "Create Virtual Directory" I get

    Unable to create the virtual directory.  Cannot create the Web site 'http://192.168.0.29:2319/'. You must specify "localhost" for the server name.

    Saturday, August 8, 2020 6:36 PM
  • User1120430333 posted

    @bruce,  I already tried that.  Sorry, when you try 100 things you're bound to miss one.

    I can't do that.  When I click "Create Virtual Directory" I get

    Unable to create the virtual directory.  Cannot create the Web site 'http://192.168.0.29:2319/'. You must specify "localhost" for the server name.

    So why can't you use local IIS and not IIS Express? 

    Saturday, August 8, 2020 7:30 PM