views:

47

answers:

2

When my code throws an error i like being brought to the line with the exception and look at all the variables with the call stack on hand. When i debug ASP.NET when an exception is thrown i dont have the visual studios IDE showing me the line and all that. How do make visual studios debug this like a normal C# winform app?

NOTE: I dont think it matters but i am using firefox as the browser. breakpoints work fine but my exceptions always occur on the page instead of IDE first.

+5  A: 
  1. Ensure you have debug="true" set in your Web.config file.
  2. Check Configuration Manager (In the Build menu) to ensure your application is running in Debug mode.
  3. Open up the Attach to Process... dialog (in the Debug menu). Click on the Select button next to the "Attach to" box and make sure it is set to "Automatically determine the type of code to debug", and that "Transport" is set to "Default"

Now set a breakpoint, press F5 and Visual Studio should take you to the appropriate line when an error occurs.

Druid
+1 good answer, and welcome to the community.
JoshJordan
I follow the steps above (i didnt have to change anything) and had no luck on exceptions. breakpoints work fine and always have.
acidzombie24
A: 

Just checking for Debug = "true" in web.config which also usually is prompted when you build your application takes care of the situation in most of the cases.

Anirudh Goel