Link to home
Start Free TrialLog in
Avatar of NewtonianB
NewtonianB

asked on

visual studio 2008 stop debugging doesnt stop execution of function

When I debug a function in .net c# visual studio 2008 and suddenly stop debugging as I want to cancel the run, the debugger actually runs everything till the end of the function right after I press stop debugging.
How can I prevent this behavior, when I stop debugging I want it to stop executing anything
SOLUTION
Avatar of Ashok
Ashok
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NewtonianB
NewtonianB

ASKER

my app is trigerred by an HTTP Request
which the app then runs 4 functions
a()
b()
c()
d()

What happens is i start debugging, run through a and b then lets say i stop debugging at b, it also runs C and D if i press stop debugging

dericstone i checked that feature i actually already have it checked
In your example above, are you stopping on a breakpoint in b(), and then stopping the debugger? If not stopping on a breakpoint, how can you be sure you are stopping in b()?

Is there any chance that another http request is coming in, and that is what is running c() and d()?

This doesn't make any sense to me.
dericstone that could be it that another request is coming in, in that scenario is there any way then to prevent from the debugger to accept more than one request at once?
I don't know of any way to control your application from the debugger. The debugger is really for looking at variables, and stepping through code so you can see the execution path. You don't usually change the execution path in the debugger. But in this case you could stop wherever your code is receiving the http request and tell the application to ignore the additional http requests. But this is probably something you should control from your application itself, or from the source of the http requests.