IIS express applicationhost.config security is reset every time a solutions is opened in VS2012

前端 未结 3 997
走了就别回头了
走了就别回头了 2021-01-04 13:09

I have an MVC4 application been developed in VS2012 that uses forms authentication.

[authentication mode=\"Forms\"]
  [forms loginUrl=\"~/Account/Login\" timeout=\         


        
相关标签:
3条回答
  • 2021-01-04 13:37

    If the problem is that Visual Studio updates the two settings in the applicationhost.config when opening the solution, you can solve it by selecting the Project in the Solution Explorer, view the Properties pane (available when you're not in debug mode) and set to Enabled the two items Anonymous Authentication and Windows Authentication.

    By the way, in my case the parameter generating the 401.2 error was just Anonymous Authentication, you might want to try to leave the default one for Windows Authentication.

    (PS, your post solved the problem for the 401.2 and really saved my day so many thanks for it!)

    0 讨论(0)
  • 2021-01-04 13:42

    You can usually use your windows account with your domain being your pc name and your windows account/password. For example pc-name\username also adding IISUSR as an account on your security settings.

    0 讨论(0)
  • 2021-01-04 13:45

    You can edit IIS authentification modes by changing

    1. iis properties in \My Documents\IISExpress\config\applicationhost.config

    2. project properties in visual studio

    The second option is your answer.

    A full answer with screenshots is already on stackoverflow : https://stackoverflow.com/a/7168308/2988788

    0 讨论(0)
提交回复
热议问题