ASP.NET MVC 网站在任何浏览器上都被重定向到本地 IIS 而不是 IIS express

ASP.NET MVC website getting redirected to local IIS instead of IIS express on any browser

目标:

本地 运行 ASP.NET IIS Express 上任何浏览器上的 MVC 网站。

历史:

相关项目是一个 ASP.NET MVC 网站,最初设置为使用启用了 SSL 的本地 IIS。我试图在 IIS Express 上设置它:

RouteConfig.cs 文件

    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 }
        );
    }

在web.config

中有两种重定向可能性

用于身份验证

<authentication mode="Forms">
  <forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>

用于错误处理

<customErrors mode="RemoteOnly" defaultRedirect="~/Views/Error/Error.html" redirectMode="ResponseRewrite">

问题:

尽管已完成上述设置,但站点正在重定向到本地 IIS (https://localhost) instead of IIS express (e.g. http://localhost/12345 or https://localhost/12345)。

到目前为止尝试了什么:

在IIS里面的网站有个问号,这个一定是ignorable

删除 https 绑定后,重定向正在进行,但页面似乎未加载。

Visual studio 允许调试 Application_Start()Configuration(IAppBuilder app)。之后,不会命中任何断点。

所有浏览器上的所有控制器和操作都会发生这种情况。

我哪里错了?还是有什么错误?

不确定这背后的黑客是什么...

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

其中 xx 的范围可以从 0 到 99

现在,重定向也没有发生。该网站在 IIS Express

上完美 运行