Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 817034 - Last Review: April 29, 2007 - Revision: 1.3
PRB: "Unable to Start Debugging on the Web Server" Error Message While You Debug ASP.NET Applications
On This Page
SYMPTOMS
You create an ASP.NET Web application and then specify that
the authentication in Internet Information Services (IIS) is set to Basic authentication. When you try to start to debug the ASP.NET Web application project in Visual Studio
.NET, you may receive the following error message:
Error while trying to run project: Unable to start debugging
on the Web server. You do not have permissions to debug the server.
Verify
that you are a member of the Debugger Users group on the server. Would you
like to disable future attempts to debug ASP.NET pages for this
project?
CAUSE
When you set authentication to Basic, the HTTP
debug request
cannot establish the username and the password for the debugger.
Therefore, the request does not reach the ASP.NET source code to debug, and
then the auto-attach debugging of processes fails.
WORKAROUND
To work around this problem, manually attach a debugger
process. You can debug an ASP.NET Web application even if you set the authentication to Basic. Follow these steps to attach an Aspnet_wp.exe process to debug
an ASP.NET Web application.
Create an ASP.NET Web Application Project
- In Microsoft Visual Studio .NET, use Microsoft Visual Basic .NET or Microsoft Visual C# .NET to create a new ASP.NET Web
application project. Name the project
DebugTest. By default, WebForm1.aspx is created.
- Right-click WebForm1.aspx, and then click View
Code.
- Change the Page_Load event as follows :
Visual C# .NET Code
private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("Hi");
}
Visual Basic .NET Code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Response.Write("Hi")
End Sub - On the Build menu, click Build
Solution.
Set Authentication to Basic
- Click Start, point to
Settings, and then click Control Panel.
- In Control Panel, double-click
Administrative Tools.
- Double-click Internet Information
Services.
- Expand Internet Information
Services, and then locate the DebugTest virtual
directory.
- Right-click DebugTest, and then click
Properties.
- Click the Directory Security tab. Under
Anonymous access and authentication control, click
Edit.
- In the Authentication Methods dialog box,
click to select the Basic authentication check box.
- Click to clear the Anonymous access check box.
Click to clear the Integrated Windows authentication
check box.
- Click OK.
Attach aspnet_wp process to Debug
- Set a breakpoint on the code in the Page_Load event.
- On the Debug menu, click Start
Without Debugging.
Note You must use the Start Without Debugging option
to see the ASP.NET worker process start. - On the Debug menu, click
Processes.
- In the Processes dialog box, select
the Aspnet_wp.exe process under Available Processes, and then click
Attach.
- In the Attach to Process dialog box, click to
select the Native and the Common Language Runtime
check boxes.
- Click OK, and then click
Close.
Note When you click OK, Visual Studio .NET may take
2 to 5 minutes to attach the process. - Type the following URL in the browser:
- Type your User Name and Password in the dialog box, and then click OK.
- Verify that you hit the breakpoint as you expect.
STATUS
This
behavior is by design.
MORE INFORMATION
Steps to Reproduce the Behavior
Create an ASP.NET Web Application Project
- In Microsoft Visual Studio .NET, use Visual Basic .NET or Visual C# .NET to create a new ASP.NET Web
application. Name the Project
DebugTest. By default, WebForm1.aspx is created.
- Right-click WebForm1.aspx, and then click View
Code .
- Change the Page_Load event as follows :
Visual C# .NET Code
private void Page_Load(object sender, System.EventArgs e)
{
Response.Write("Hi");
}
Visual Basic .NET Code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Response.Write("Hi")
End Sub - On Build menu, click Build
Solution.
Set Authentication to Basic
- Click Start, point to
Settings, and then click Control Panel.
- In Control Panel, double-click
Administrative Tools.
- Double-click Internet Information
Services.
- Expand Internet Information
Services, and then locate the DebugTest virtual
directory.
- Right-click DebugTest, and then click
Properties.
- Click the Directory Security tab. Under
Anonymous access and authentication control, click
Edit.
- In the Authentication Methods dialog box,
click to select the Basic authentication check box.
- Click to clear the Anonymous access check box.
Click to clear the Integrated Windows authentication
check box.
- Click OK, and then click OK again.
Debug the Project
- Set the breakpoint on the code in the Page_Load event.
- On the Debug menu, click
Start.
- You receive the error message that is described in the "Symptoms"
section.
REFERENCES
For more information about how to debug ASP.NET, visit the
following Microsoft Developer Network Web site:
Debugging ASP.NET Web Applications
http://msdn2.microsoft.com/en-us/library/w2faa92k(vs.71).aspx
(http://msdn2.microsoft.com/en-us/library/w2faa92k(vs.71).aspx)
For additional information, click the following article
numbers to view the articles in the Microsoft Knowledge Base:
306172Â
(http://kbalertz.com/Feedback.aspx?kbNumber=306172/EN-US/
)
INFO: Common Errors When You Debug ASP.NET Applications in Visual Studio .NET
318041Â
(http://kbalertz.com/Feedback.aspx?kbNumber=318041/EN-US/
)
HOW TO: Set Up and Use Remote Debugging in Microsoft Visual Studio .NET
306169Â
(http://kbalertz.com/Feedback.aspx?kbNumber=306169/EN-US/
)
PRB: Visual Studio .NET Debugger Does Not Stop on Breakpoints When You Debug ASP.NET Pages
APPLIES TO
- Microsoft ASP.NET 1.0
- Microsoft ASP.NET 1.1
| kbdebug kbauthentication kberrmsg kbwebforms kbprb KB817034 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate
Be the first to leave feedback, to help others about this knowledge base
article.
(Optional) Name
(Optional)
Public URL Or Email
Comments
No
HTML -- Text Only Please