jim
jim

Reputation: 27426

Visual Studio 2008 Debugging

I have an application that has two distinct parts, one operation that process data and adds it to a database and a second operation that retrieves the data and makes a report. Is there a way to tell the debugger to start at the second operation of the application? Previously I've commented out what I didn't want to run and worked around my issue in that way. Is there a better way? Thanks.

Upvotes: 0

Views: 122

Answers (3)

Mark
Mark

Reputation: 41

If your language has an equivilent to #ifdef you could use that and a runtime parameter to avoid repeatedly commenting out code.

Edit: This assumes you don't want the first operation to run for whatever reason, question's a bit vague.

Upvotes: 1

Brian
Brian

Reputation: 118895

Breakpoints? E.g. assuming the app structure is

DoTheFirstPart()
DoTheSecondPart()

put a breakpoint on the second part and run in the debugger, and then once you hit the breakpoint, do whatever other debugging you need (add more breakpoints, turn on catch-all-exceptions, etc.) This will still run the first part - it's unclear to me if that's what you want or not.

(Question is a little vague, it's unclear what strategies you know/tried and what your goal is.)

Upvotes: 2

RichardOD
RichardOD

Reputation: 29157

I assume you have two methods in one piece of code, such as a Main method?

Main() 
{
   DoOperationOne();
   DoOperationTwo();
}

An easy way to skip over one is to read about Set the Next Statement.

Upvotes: 1

Related Questions