Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Abort a thread from debugger
Message
From
17/01/2014 12:57:12
 
 
To
17/01/2014 10:10:31
General information
Forum:
ASP.NET
Category:
Visual Studio
Environment versions
Environment:
VB 9.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01591981
Message ID:
01592092
Views:
29
>>>>>>When debugging a thread in VS using 'Stop Debugging' does not stop thread execution.
>>>>>>
>>>>>>I guess this is logical but is there any way, using the IDE, to abort the thread?
>>>>>
>>>>>
>>>>>The only thing I find ( whether it is a process started within the IDE, or a process you attached to ) is Terminate all
>>>>>
>>>>>Attached to Excel - terminate all - and gone was the excel
>>>>
>>>>Where do you find 'terminate all' ?
>>>
>>>
>>>Debug menu
>>>
>>>Second line under 'Stop Debugging'
>>>
>>>
>>>(using vs 2013)
>>
>>Must be going blind :-{ - I stared at those menu options before posting and didn't see it.
>>
>>Ah, now I see why I missed it - the option is only there once debugging has commenced.
>>Haven't verified that it stops the thread but I'm sure it would.
>>Thx...
>
>
>I was a bit confused when you asked how to abort a thread

Code like this:
var rh = new RebateHandler(false);
                var thread =
                    new Thread(() => rh.Run(Convert.ToDateTime(txtStartDate.Text), Convert.ToDateTime(txtEndDate.Text)));
                thread.Start();
If I set a breakpoint within the Run() method the debugger kicks in but if I then just 'Stop Debugging' the thread continued to run.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform