Running Windows 10 Pro workstation. New clean install. Built a small 2-page brochureware site which tested OK within Visual Studio 2015. I’m now trying to get IIS server to work so I can test from another workstation on my lan. I’m an IIS newbie and the setup seems a bit byzantine. I can get IIS to serve a simple .htm page from another workstation, but nothing doing with MVC.
Here's how IIS is configured:
Anonymous Authentication enabled
Credentials set to “Application Pool Identity”
Application bindings set as http: port 80, https: port 443
Project properties:
Start action: current page
Servers:
Apply server settings to all users – checked
Local IIS – Project url = http://<wkstn name>/<site name>
Override application root url – unchecked
Package/Publish Web]
Include IIS settings as configured in IIS – checked
No resource file
No settings file
Published using file system to c:\inetpub\wwwroot\<application>
Following code in global.asax in order to force all pages to https:
protected void Application_BeginRequest()
{
if (FormsAuthentication.RequireSSL && !Request.IsSecureConnection)
{
Console.WriteLine("Got here");
Response.Redirect(Request.Url.AbsoluteUri.Replace
("http://", "https://"));
}
}
All controller pages have [RequireHttps]
Using self-signed certificate.
When I use the url http://<computer name>/<app name> format from the other workstation I get the certificate warning, followed by a 404 error. If I change it to https I get the same result.
When I do the same sequence on the development workstation I get the same result.
If I change the url to http://localhost/<app name> it seems to work, but after a quick test I determined that it is going to the development build, not the published build.
Any suggestions will be very much appreciated.