Thursday, March 31, 2005

Solution for "Cannot start debugging on web server, Access is denied" error when trying to run Asp.net Application

You may receive an "Access is denied" error message when you try to debug a Web application, and you have administrative permissions in Visual Studio .NET
Article ID
:
894433
Last Review
:
March 25, 2005
Revision
:
2.0
On this page

SYMPTOMS

CAUSE

RESOLUTION


MORE INFORMATION


REFERENCES
SYMPTOMS
You may receive the following error message when you try to debug a Web application:
Access is DeniedThe problem occurs when the following conditions are true:

You are logged on to your computer with administrative permissions.

You are debugging a Web application in Microsoft Visual Studio .NET.

The operating system that you are using is Microsoft Windows XP Service Pack 2.

The Microsoft ASP.NET worker process account is not a member of the Administrators group.
CAUSE
The problem occurs because the ASP.NET worker process does not have the Impersonate a client after authentication user right. If the worker process account does not have this right, the debugger cannot attach to the process. The worker process account is configured by using the processModel element in the Machine.config file.
RESOLUTION
To give the worker process account the Impersonate a client after authentication user right, follow these steps:
1.
Click Start, point to Settings, and then click Control Panel.
2.
Double-click Administrative Tools.
3.
Double-click Local Security Policy.
4.
Expand Security Setting, expand Local Policies, and then click User Rights Assignment.
5.
In the Policy pane, right-click Impersonate a client after authentication, and then click Properties.
6.
Click Add User or Group.
7.
Add the worker process account that is configured in the processModel element in the Machine.config file.
8.
Click OK two times.
9.
Click Start, click Run, type iisreset, and then click OK.
10.
At a command prompt, type the following command to refresh policies on the computer:
gpupdate /forceMORE INFORMATION
Steps to reproduce the problem
1.
Open the Machine.config file. Locate the processModel element.
2.
Replace the username attribute and the password attribute as a non-administrative user.
3.
Restart Internet Information Services (IIS).
4.
Log off your computer. Log on your computer so that you have administrative permissions.
5.
Start Visual Studio .NET.
6.
Create a new Web application.When you try to debug the Web application, you may receive the following error message:
Error while trying to run project: Unable to start debugging on the web server. Access is denied.REFERENCESFor more information about developing software in Visual Studio .NET that has non-administrative permissions, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/tchDevelopingSoftwareInVisualStudioNETWithNon-AdministrativePrivileges.asp

No comments: