Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Debugging without executing your application

I came across Habib Heydarian's blog and he has one of the coolest tips I've seen in a while with debugging.  Habib shows how to debug an application without actually running it.

He uses the Immediate Window (Debug –> Windows –> Immediate Window) to actually create an instance of the Window then uses the Show Dialog method to display it.  Since this code is executing, it will trigger break points in your code! 

Via [10-4 episode on the Historical Debugger in Visual Studio 2010]

Tags:

Follow the Discussion

  • AlesguzAlesguz

    Great...!!! I'll try it right now.

  • Steve BargeltSteve Bargelt

    Really? 1) it takes longer to type the friggin' commands out then to hit F5 and click a button. 2) How many sub form don't depend on some data being passed from a parent form. 3)He states there is NO WAY to set your startup form? Huh? The app just picks one at random? I think NOT!

  • Clint RutkasClint I'm a "developer"

    @Steve Bargelt, if you have an application that has tons of forms, it can become very time consuming to click through everything to get to the item you want.  And then you can test, close, tweak, hit up in the intermediate window which will repeat the last command, hit enter and bam, it repeats.  If a form needs data sent, you may be able to mock it out.  This may not work in every scenario but it is one tool to help out.

    He is wrong regarding no way to declare what form is the start up form.  That can be configured in App.Xaml by changing the StartupUri attribute in the root.

    Good catch.

  • voidfoovoidfoo

    One thing to know is that for C# projects Visual Studio actually starts a debugging session for you behind the scene.

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.