[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 589
  • Last Modified:

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
0
NewtonianB
Asked:
NewtonianB
  • 3
  • 2
2 Solutions
 
AshokCommented:
Stop Debugging option is supposed to be used when you have endless loop and completely stop execution.

Try "Step Over" option.

0
 
dericstoneCommented:
Are you running multiple processes, or using RPC, or using P/Invoke or anything "fancy"? Normally in pure C# the debugger should stop immedately and should not run to the end of a method. Of course, there is some latency. If you need to stop on a specific iteration of a loop, I suggest you use a conditional breakpoint.

The only thing I can think of is in the Visual Studio Tools -> Options, select Debugging in tree, select General, and make sure you have checked "Break all processes when one process breaks".

Otherwise, tell us how your app is structured.
0
 
NewtonianBAuthor Commented:
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
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
dericstoneCommented:
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.
0
 
NewtonianBAuthor Commented:
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?
0
 
dericstoneCommented:
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.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now