Hi,
I am a newbie to .NET, recently I installed .NET. I could not debug using breakpoints, breakpoints are not getting hit, but the application is working fine with out any issue.
If I press F5 or Start Application is working fine. “Start without debugging” is also working fine. But the breakpoints are not getting hit by the process. I am not getting any error.
It would be grateful if you give me a solution for this issue.
I created a sample web (ASP.NET -default) application and put a breakpoint in the page load event and executed but still break points are not hit.
I have given my settings below...
=====================================================================
IN VS.NET
=====================================================================
1. Web.config debug=true
2. Solution Configuration = Debug Solution--> Properties--> Common Properties-->Debug Symbol Files -- --Is blank - Is it OK
3. Project--> Properties--> Configuration--> Build--> Generate Debugging ----Information is checked
4. Project-->Properties-->Configuration--> Debug--> ASP.NET debugging ----True
5. Breakpoints are available in the breakpoint window (I just checked in run mode via Debug-->Windows-->Breakpoints)
6. I tried to attach manually I got the following error
? Very first time there was nothing selected in the “choose the program type that you want to debug:” dialog
? I have selected “Common language Runtime” and clicked “Ok”
? I got this error
? But next time I opened the same dialog, “Common language runtime” has been selected but I got the same error while clicking “Ok”
7. Auto attach - ASPNET_WP.exe If I start the application, I could see the auto-attach status in the output window.
8. PDB – File is available, I can see the .pdb file in the bin folder, (dll/exe/pdb - modified dates are same)
9. User and PC details
? Windows XP + SP2
? IIS 5.1
? Login as local administer
? This user is part of “Debugger Programmers”
=====================================================================
In IIS
=====================================================================
1. IIS--> Application-->Configuration--> Debugging-->Enable ASP Server side debugging----- is checked
2. IIS--> Application-->Directory Security--> Enable anonymous and integrated windows authentication are both checked
It would be grateful if you give any idea. Many thanks.
Regards
MSK.

Break points are not getting hit in ASP.NET (C#)
Gary RUsh
To break into a remote object, you have to put this line of code.
System.Diagnostics.Debugger.Break;
When you run the program, you will be prompted that a break operation has been caught, and it will ask you if you would like to ignore it or debug it. Choose to debug it, and then you will be able to load the remote object into your VS debugger.
NeilC
You need to place it in the code in the remote class.
smtraber
Pradeep Gupta
Hi,
What kind of error are you getting when you try to attach to process
And what process are you trying to attach to
Max
Sebcio
Hi Max/Nick
Thanks for your reply,
Sorry I missed the error message in my previous mail.
I have given more input, hope this helps you to give me some idea
1. I am getting the following error while debugging any newly created project (C#, ASP.NET) ,
"Error while trying to run project: Unable to start debugging on the web server"
and I could see the following error message in the output window
"Auto-attach to process '[2684] aspnet_wp.exe' on machine XXXXX failed."
To avoid this error I am doing the following.
Project-->Properties-->Configuration Properties --> Debugging --> Enable SQL Debugging
By default "Enable ASP.NET debugging" set as "True"
After this I am not getting this error message for this current project.
2. I tried to attach manually I got this error "Unable to attach to the process"
? Very first time there was nothing selected in the “choose the program type that you want To debug:” dialog
? I have selected “Common language Runtime” and clicked “Ok”
? I got this error "Unable to attach to the process"
? But next time I opened the same dialog, “Common language runtime” has been selected but I Got the same error while clicking “Ok”
3. I can see the following line in the output window when the application running
Auto-attach to process '[2684] aspnet_wp.exe' on machine XXXXX succeeded.
4. I am not testing with the original application; I have created a sample application
The default application (C# + ASP.NET WEB application), not complicated files (no extra modules/projects)
5. I have tried with so many break points in different places.
6. I have IIS, and SQL server in the same laptop.
7. This issue occurs only for web based application. (If I create windows application (C# or VB), I could debug using break points.
Many Thanks
Regards
MSK.
Selvalakshmi