新Asp.Net MVC5项目产生无限循环到登录页面 [英] New Asp.Net MVC5 project produces an infinite loop to login page

查看:649
本文介绍了新Asp.Net MVC5项目产生无限循环到登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建与Visual Studio 2013年全新谟,我选择Asp.Net MVC和框架4.5.1创建项目的话,我什么都不做比其他F5启动默认的网页。不幸的是,它会产生一个重定向到被重定向到登录页面过于登录页面。这里是我的网址在浏览器中的一个短版:

<$p$p><$c$c>http://localhost:5285/Account/Login?ReturnUrl=%2FAccount%2FLogin%3FReturnUrl%3D%252FAccount%252FLogin%253FReturnUrl%253D%25252FAccount%25252FLogin%25253FReturnUrl%25253D%2525252FAccount%2525252FLogin%2525253FReturnUrl%2525253D%252525252FAccount%252525252FLogin%252525253FReturnUrl%252525253D%25252525252FAccount%25252525252FLogin%25252525253FReturnUrl%25252525253D%2525252525252FAccount%2525252525252FLogin%2525252525253FReturnUrl%2525252525253D%252525252525

我没有在事件查看器的任何错误。但是在屏幕上我看到:


  

HTTP错误404.15 - 未找到请求筛选模块
  配置为拒绝请求在查询字符串太长。


该网站在IIS防爆preSS默认设置运行。我怎样才能解决这个问题?我猜的东西是错误与我的Visual Studio 2013?

修改

如果我创建了一个全新的网站,我在IIS中承载它它的工作原理。但是,如果我创建了一个新的网站(不修改任何东西),只是打戏(其中默认启动IIS前preSS),它没有。

编辑2

我在文档\\ IISEx preSS \\设置\\删除对ApplicationHost.config每网站。我已经重新编译一切,它创造了这个条目:


        
            
                
            
            
                
            
        

 &LT; siteDefaults&GT;
        &LT;日志文件的LogFormat =W3C目录=%IIS_USER_HOME%\\日志/&GT;
        &LT; traceFailedRequestsLogging目录=%IIS_USER_HOME%\\ TraceLogFiles启用=真maxLogFileSizeKB =1024/&GT;
    &LT; / siteDefaults&GT;
    &LT; applicationDefaults applicationPool =Clr4IntegratedAppPool/&GT;
    &LT; virtualDirectoryDe​​faults allowSubDirConfig =真/&GT;
&LT; /网站&GT;

我仍然得到与IIS防爆preSS的错误,而不是与IIS。


解决方案

请注意,这是潜在有害的意见,这是很少一个好主意,直​​接修改applicationhost配置文件,通常有工具,会做这对你来说,安全(例如,从Visual Studio中。)出发之前,请务必在您的IIS前preSS变得丢弃事件来创建此文件的备份副本。

要解决这个问题,我把设在这里默认的IIS配置文件:

  C:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\的applicationHost.config

要在我的文档

 %USERPROFILE%\\文件\\ iisex preSS \\设置\\对ApplicationHost.config

和它的工作。

这是因为我有一些的Windows身份认证集,而不是匿名帐户。

I am creating a brand new projet with Visual Studio 2013, I choose Asp.Net MVC and the framework 4.5.1 The project is created, then, I do nothing else than F5 to start the default web page. Unfortunately, it produces a redirect to the login page which is redirecting into the login page too. Here is a short version of the url I have in the browser:

http://localhost:5285/Account/Login?ReturnUrl=%2FAccount%2FLogin%3FReturnUrl%3D%252FAccount%252FLogin%253FReturnUrl%253D%25252FAccount%25252FLogin%25253FReturnUrl%25253D%2525252FAccount%2525252FLogin%2525253FReturnUrl%2525253D%252525252FAccount%252525252FLogin%252525253FReturnUrl%252525253D%25252525252FAccount%25252525252FLogin%25252525253FReturnUrl%25252525253D%2525252525252FAccount%2525252525252FLogin%2525252525253FReturnUrl%2525252525253D%252525252525

I do not have any error in the Event Viewer. But in the screen I see :

"HTTP Error 404.15 - Not Found The request filtering module is configured to deny a request where the query string is too long."

The website is running with the default setting in IIS Express. How can I fix this problem? I am guessing something is wrong with my Visual Studio 2013?

Edit

It works if I create a brand new website and I host it in IIS. But if I create a new website (without modifying anything) and just hit play (which start IIS Express by default), it doesn't.

Edit 2

I have deleted every websites in the Documents\IISExpress\config\applicationhost.config. I have recompiled everything, and it created this entry :

    <siteDefaults>
        <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
        <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
    </siteDefaults>
    <applicationDefaults applicationPool="Clr4IntegratedAppPool" />
    <virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>

I am still getting the error with IIS Express, not with IIS.

解决方案

Please be aware that this is potentially harmful advice, it's rarely a good idea to modify an applicationhost config file directly, there are usually tools that will do this for you, safely (for example, from within Visual Studio.) Before proceeding, be sure to create a backup copy of this file in the event your IIS Express becomes trashed.

To fix this problem, I took the default IIS configuration file located here :

C:\Windows\System32\inetsrv\config\applicationHost.config

To my document

%userprofile%\documents\iisexpress\config\applicationhost.config

And it worked.

This was because I had some Windows Authentification set and not the anonymous account.

这篇关于新Asp.Net MVC5项目产生无限循环到登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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