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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Stop Debugging option is supposed to be used when you have endless loop and completely stop execution.

Try "Step Over" option.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NewtonianBAuthor Commented:
my app is trigerred by an HTTP Request
which the app then runs 4 functions

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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

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.
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?
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.