Hello,
I had a similar problem. I did the following:
STEP 1
- In the web.config file, I added <compilation debug="true" /> under the <system.web> node as suggested by pohare2.
- However, I then get the following error when I hit F5 (Start):
-- This is what appears in a message box: "Error while trying to run the project: Unable to start debugging on the web server. There is no managed code running in the process. In order to attach to a process with the .NET debugger, managed code must be running in the process before attaching."
-- This is the message in the Output window: "Auto-attach to process '[516] aspnet_wp.exe' on machine '<MACHINE-NAME>' failed. Error code 0x8004000e."
STEP 2
- To solve the above error message, I found the way to manually attach to the aspnet_wp.exe process. You have to hit CTRL+F5 (Start without debugging). This will open the default page in IE without the debugging. Then go to Debug/Processes in the IDE and select aspnet_wp.exe and click Attach button. This method is mentioned in the .NET Framework Help.
- Ok, so doing that showed the Debug Pause and Stop buttons in the .NET IDE.
- Now, I add a breakpoint in the Registration page at the btnRegistor_Click event. In the IE window that is already opened by CTRL+F5, I go to the registration page, hit the Register button and it does not stop at the breakpoint.
- Closing IE window (that initially opened through CTRL+F5) does not stop the code execution. You have to hit the Stop button yourself.
Can anyone tell me:
1) How I can step through the entire code?
2) Why should I have to manually attach aspnet_wp.exe?
3) Why will .NET not do it on it's own? Or rather, what can I do to make it attach on it's own and simply hit F5 to run the project and be able to step through it?
I have another much bigger ASP.NET project running on my desktop (a different machine than this) that I downloaded from our VSS Server and didn't have any of these issues. I can step through the entire code and I do not have to do any manual attaching. I will look at the web.config file and project properties for it tomorrow. I hope I can figure this out but please advise me on this.
Thanks in advance for your help.