vNext重定向到登录返回404

时间:2016-02-03 14:22:19

标签: asp.net-mvc iis

我正在使用vNext并且运行良好的localhost但在服务器上重定向登录功能会将我发送到正确的URL(XXX /帐户/登录?ReturnUrl =%2FMonitoring)但是我收到错误消息。

select id from tt
where id in (1,2,4,6)
and (select count(distinct id) from tt where id in (1,2,4,6)) = 4

方法:

404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Startup.cs

[HttpGet]
        [AllowAnonymous]
        public IActionResult Login(string returnUrl)
        {            
            ViewBag.ReturnUrl = returnUrl;

            return View();
        }

我正在使用app.UseCookieAuthentication(options => { options.AutomaticAuthenticate = true; options.AutomaticChallenge = true; options.AuthenticationScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.CookieName = "WnctAuthCookie"; if (!env.IsDevelopment()) options.CookieSecure = CookieSecureOption.Always; options.ExpireTimeSpan = TimeSpan.FromMinutes(60); options.SlidingExpiration = true; options.LoginPath = new PathString("/Account/Login"); options.LogoutPath = new PathString("/Account/Logout"); }); ,我也在Windows 7下使用IIS 7.5并启用了https。

我不确定天气是由于IIS或其他设置造成的。有没有人有解决方案?

1 个答案:

答案 0 :(得分:1)

我不确定,但我认为你必须输入文件名,扩展名为

  options.LoginPath = new PathString("/Account/Login.aspx");
  options.LogoutPath = new PathString("/Account/Logout.aspx");