Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot debugging asp.net on IIS7 by attaching process w3wp

I have a asp.net website in VS2008 which I have pre-compiled in local directory which is virtual directory for IIS 7(http://machinename:83)

when i 1. launch http://machinename:83/ 2. VS2008-->debug-->Attach to Process..-->select w3wp.exe 3. set the breakpoint in code in VS2008 4. run app

while i found it cannot go to the breakpoint. (i m sure the breakpoint must be run)

anybody can help me on this?

like image 525
max Avatar asked Mar 07 '11 14:03

max


2 Answers

What you're doing should work, but you can try this, which is frequently used to debug Windows services upon startup:

System.Diagnostics.Debugger.Launch();

Just put it on the line where you want to start debugging, and the OS will prompt you to attach.

like image 117
Josh Pearce Avatar answered Sep 28 '22 02:09

Josh Pearce


If you are using the Publish Web Site feature in Visual Studio, then make sure that the 'Emit debug information' checkbox is checked.

like image 30
David J. Avatar answered Sep 28 '22 04:09

David J.