New Asp.Net MVC5 project produces an infinite loop to login page

后端 未结 21 3181
粉色の甜心
粉色の甜心 2020-11-29 20:12

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 d

21条回答
  •  -上瘾入骨i
    2020-11-29 20:42

    You are missing [AllowAnonymous] attribute on login action.

    [AllowAnonymous]
    public ActionResult Login(string returnUrl)
    {
        // code....
    }
    

    2nd possibility, specific to IIS Express only: is that, if you created same default WebApplication1 project multiple times, playing with different authentication settings, IIS Express stored additional authentication settings in it's configuration file. Something like:

        
            
                
                    
                        
                        
                    
                
            
        
    
    

    Configurations are in user's Documents folder Documents\IISExpress\config\, and you should look for:

    applicationhost.config
    

    Then just delete xml node mentioned above.


    Update for VS 2015+

    If you're using Visual Studio 2015 or higher, check this path for the config file: $(solutionDir)\.vs\config\applicationhost.config

    Each solution will have its own config file.

提交回复
热议问题