Microsoft KB Archive/942044

= Error message when you try to run a Web application that is hosted on IIS 7.0: &quot;HTTP Error 401.1 - Not Found&quot; =

Article ID: 942044

Article Last Modified on 9/25/2007

-

APPLIES TO


 * Microsoft Internet Information Services 7.0

-



SYMPTOMS
When you try to run a Web application that is hosted on a server that is running Internet Information Services (IIS) 7.0, you may receive an error message that resembles one of the following error messages:

Error message 1

Server Error in Application &quot; &quot;

HTTP Error 401.1 - Not Found

HRESULT: 0x8009030c

Description of HResult: You do not have permission to view this directory or page using the credentials that you supplied.

Error message 2

Server Error in Application &quot; &quot;

HTTP Error 401.1 - Not Found

HRESULT: 0x8007052e

Description of HResult: You do not have permission to view this directory or page using the credentials that you supplied.



CAUSE
This problem occurs because the list in the Web.config file of the Web application is set to restrict certain users. This setting appears even though IIS 7.0 is configured to authenticate users who have valid Windows credentials. The list is in the section of the Web.config file.

Note The Web application uses the settings in the Web.config file to configure the Web application.



RESOLUTION
To resolve this problem, use one of the following methods.

Method 1
In the list of the Web.config file, add all users to whom you want to assign permissions. To do this, follow these steps:  On the server that is running IIS, click Start, type notepad in the Start Search box. In the Programs list, right-click Notepad, and then click Run as administrator.

If you are prompted for an administrator password or for a confirmation, type your password or click Continue. On the File menu, click Open. Locate the folder that contains the files for the Web application. In the File name box, type web.config, and then click Open.  In the Web.config file, locate the following lines of code.   Add the list to the Web.config file. Add to the list all users to whom you want to assign permissions. <ul>  To assign permissions for the Web application to all users in a certain group, add the following code. <allow roles=&quot;<domain_name>\<group_name>&quot; /> <deny users=&quot;*&quot; /> </li>  To assign permissions only to specific users, add the following code. <allow users=&quot;<domain_name>\ ,<domain_name>\ ,<domain_name>\ &quot; /> <deny users=&quot;*&quot; /> </li></ul> </li> On the File menu, click Save.</li> On the File menu, click Exit.</li></ol>

Method 2
Log on to the Web application by using the credentials of a user who appears in the list of the Web.config file.

<div class="moreinformation_section">

MORE INFORMATION
For more information, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/wce3kxhd(vs.71).aspx

Keywords: kbexpertiseadvanced kbtshoot kbprb KB942044

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.