Joseph Campbell
Joseph Campbell

Reputation: 330

iis hosted web site differs from local web site

My local MVC ASP.NET project comes fully loaded and I can properly interact with it's controllers and API's

enter image description here

However, when I run the web site in IIS I get the following result, a horizontal blue bar across the screen

enter image description here

I am following this tutorial

Below are my settings for the site

enter image description here

When I click Test Settings, both authentication and authorization are green, and I have successfully added my user in Connect as...

My site bindings are below enter image description here

I have changed my application pools to .NET v4.0 but that didn't fix anything, I am not sure if I should change them back or not.

Lastly, here is the list of enabled Windows Features.

enter image description here

Upvotes: 0

Views: 69

Answers (1)

Bork Blatt
Bork Blatt

Reputation: 3368

Someone has registered the domain localhost.net - and the screenshot you show looks similar to what I get if I browse to that domain. I'm not sure why the tutorial would recommend that you use an existing domain to test against, even if you are "overriding" it by editing your hosts file.

The simplest fix would be to change the IIS binding to use a specific port (e.g. 9000), instead of the host header. Then you would access your site via an address like http://localhost:9000 or http://127.0.0.1:9000 but if you want to use the host header per the example, open the hosts file and check that your file has the exact entry in it per the tutorial. NB when editing the hosts file your editor needs to be running as Administrator or you won't be able to save the changes.

To test if your hosts file is correct, open a command prompt and ping webapi.localhost.net - if the IP address is not 127.0.0.1, your change is not taking effect.

Here is an example of binding to a port with no host header:

Screenshot of IIS showing a port binding

Upvotes: 1

Related Questions