Reputation: 31237
Aim:
Locally run ASP.NET MVC website on IIS express on any browser.
History:
The project in concern is an ASP.NET MVC website which initially was setup to use Local IIS with SSL enabled. I tried to set it up on IIS express:
RouteConfig.cs file
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "_View", id = UrlParameter.Optional }
);
}
There are 2 redirection possibilities in web.config
For authentication
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
For error handling
<customErrors mode="RemoteOnly" defaultRedirect="~/Views/Error/Error.html" redirectMode="ResponseRewrite">
Problem:
Although the above setting is done, the site is getting redirected to Local IIS (https://localhost) instead of IIS express (e.g. http://localhost/12345 or https://localhost/12345).
What is tried so far:
Apply server settings to all users (store in project file)
is checked.There is a question mark on the site which inside IIS, this must be ignorable
After removing https binding, the redirection is happening however the page seems to be not loading.
Visual studio is allowing to debug the Application_Start()
and Configuration(IAppBuilder app)
. Afterwards, any break point is not hit.
This is happening with all controllers and actions on all browsers.
Upvotes: 3
Views: 4972
Reputation: 31237
Not sure what is the hack behind this...
To run an ASP.NET MVC website on IIS Express (instead of Local IIS) with SSL enabled, one need to make sure that the 5 digit URL port starts with 443xx
where xx can range from 0 to 99
Now, the redirection is also not happening. The website is perfectly running on IIS Express
Upvotes: 3