Thursday, November 15, 2012

Visual Studio 2012 Error message 401.2.: Unauthorized: Logon failed due to server configuration

Hi,

Have started to learn how to build ASP.NET MVC applications using Visual Studio 2012, and have decided to share my experiences hoping that they will benefit those who are making a similar journey.

One of the first errors that I picked up in running the MVC tutorial at: http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/intro-to-aspnet-mvc-4

was:

Server Error in '/' Application.

Access is denied.


Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.

Error message 401.2.: Unauthorized: Logon failed due to server configuration.  Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server.  Contact the Web server's administrator for additional assistance.



Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929 



Resolved by:

1.  Pressing F4 which brings up the Properties pane in the bottom right hand corner:

2, Choosing the application in the Solution Explorer pane. This will then display all the properties relevant to the project in the Properties pane.

3. Change the "Windows Authentication" property to Enabled.

Solution courtesy:

http://saravananarumugam.wordpress.com/2012/03/22/error-message-401-2-unauthorized-logon-failed-due-to-server-configuration/