Blog from Saravanan Arumugam

Let us talk about Technologies

Tag Archives: IIS Express

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


I was trying to get my MVC 3 web application work through IIS 7.5 Express, and when I ran the application I got the following error.

Exception

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.

 

Solution

As the first step I had to look at the web.config. The authentication mode was set to Windows Authentication.

    <authentication mode="Windows" />
    <authorization>
      <deny users="?" />
    </authorization>

Even though the web.config says that I need windows authentication, IIS Express need to be informed about it.

To resolve it, I did the following.

1. Clicked on the Web Project, and hit F4. (Right click and properties will get you to a different place)

2. Made sure that I can see the Properties Pane. (Not the property window).

3. Select Enabled for the Windows Authentication Property.

image

This would enable the windows authentication and get rid of the exception.

Advertisements

Use IIS Express option doesn’t appear on the context menu of a Web based Project


I wanted to use IIS express as the development server instead of Visual studio’s built in Development Server. For that I had to install Visual Studio 2010 SP1 and IIS 7.5 Express.

However in Visual Studio, I couldn’t fine the option “Use IIS Express” when I right click on the web project.

 

Solution

As an alternate to selecting Use IIS Express, right click on the project select Properties. In the property page select the Web Tab. Here, select Use Local IIS Web Server.

Make sure that Use IIS Express is checked.

image

This will ensure that the web application is starting in IIS Express.