Microsoft Knowledge Base Email Alertz

KBAlertz.com: (817034) - 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 Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








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

  1. 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.
  2. Right-click WebForm1.aspx, and then click View Code.
  3. 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
  4. On the Build menu, click Build Solution.

Set Authentication to Basic

  1. Click Start, point to Settings, and then click Control Panel.
  2. In Control Panel, double-click Administrative Tools.
  3. Double-click Internet Information Services.
  4. Expand Internet Information Services, and then locate the DebugTest virtual directory.
  5. Right-click DebugTest, and then click Properties.
  6. Click the Directory Security tab. Under Anonymous access and authentication control, click Edit.
  7. In the Authentication Methods dialog box, click to select the Basic authentication check box.
  8. Click to clear the Anonymous access check box. Click to clear the Integrated Windows authentication check box.
  9. Click OK.

Attach aspnet_wp process to Debug

  1. Set a breakpoint on the code in the Page_Load event.
  2. 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.
  3. On the Debug menu, click Processes.
  4. In the Processes dialog box, select the Aspnet_wp.exe process under Available Processes, and then click Attach.
  5. In the Attach to Process dialog box, click to select the Native and the Common Language Runtime check boxes.
  6. Click OK, and then click Close.
    Note When you click OK, Visual Studio .NET may take 2 to 5 minutes to attach the process.
  7. Type the following URL in the browser:
    http://localhost/DebugTest/WebForm1.aspx (http://localhost/DebugTest/WebForm1.aspx)
  8. Type your User Name and Password in the dialog box, and then click OK.
  9. 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

  1. 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.
  2. Right-click WebForm1.aspx, and then click View Code .
  3. 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
  4. On Build menu, click Build Solution.

Set Authentication to Basic

  1. Click Start, point to Settings, and then click Control Panel.
  2. In Control Panel, double-click Administrative Tools.
  3. Double-click Internet Information Services.
  4. Expand Internet Information Services, and then locate the DebugTest virtual directory.
  5. Right-click DebugTest, and then click Properties.
  6. Click the Directory Security tab. Under Anonymous access and authentication control, click Edit.
  7. In the Authentication Methods dialog box, click to select the Basic authentication check box.
  8. Click to clear the Anonymous access check box. Click to clear the Integrated Windows authentication check box.
  9. Click OK, and then click OK again.

Debug the Project

  1. Set the breakpoint on the code in the Page_Load event.
  2. On the Debug menu, click Start.
  3. 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
Keywords: 
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