ASP.NET MVC的网站得到重定向到本地IIS,而不是IIS表示在任何浏览器 [英] ASP.NET MVC website getting redirected to local IIS instead of IIS express on any browser

查看:139
本文介绍了ASP.NET MVC的网站得到重定向到本地IIS,而不是IIS表示在任何浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目的:

本地IIS上运行ASP.NET MVC网站表示在任何浏览器

Locally run ASP.NET MVC website on IIS express on any browser.

历史:

在关注该项目是一个ASP.NET MVC的网站最初是设置使用具有本地IIS启用S​​SL。我试着将它设置在IIS上表示:

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:

< STRONG> 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中2重定向可能性

有关身份验证

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

有关错误处理

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



问题:

虽然上述设置完成后,该网站是越来越重定向到本地IIS(的https://本地主机),而不是IIS快递(例如:的http://本地主机/ 12345 或的 HTTPS://本地主机/ 12345

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.
  • Added _CSRUN_DISABLE_WORKAROUNDS and repaired IIS
  • MVC WebApplication no longer starts in IIS Express (redirects to https://localhost in Chrome)
  • Tried recreating virtual directory
  • UrlRewrite is not stopped
  • Old certs are deleted

有一个问题标志,它里面的IIS,这一定是忽略

There is a question mark on the site which inside IIS, this must be ignorable

删除HTTPS绑定后,重定向然而发生在页面似乎不加载。

After removing https binding, the redirection is happening however the page seems to be not loading.

Visual Studio是允许调试的Application_Start()配置(IAppBuilder应用)。此后,任何破发点不打。

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.

推荐答案

不知道这背后...

要运行在IIS快递(而不是本地IIS)启用SSL,一个ASP.NET MVC的网站一是需要确保在5位数的URL端口 443 XX

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

where xx can range from 0 to 99

现在,在重定向也没有发生。该网站上的IIS快递

Now, the redirection is also not happening. The website is perfectly running on IIS Express

这篇关于ASP.NET MVC的网站得到重定向到本地IIS,而不是IIS表示在任何浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆