Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First and foremost,</p> <blockquote> <p>I want all thredas spawned by the addin to be terminated immediately.</p> </blockquote> <p><strong>No, you don't.</strong> What you want is the other threads to stop running themselves in a normal manner. Asynchronous exceptions (such as <code>ThreadAbortException</code>) are likely to leave the application in a bad state, which is the complete opposite of what you're trying to accomplish.</p> <p>Without knowing the specific reason why your add-in has multiple threads, I can only make the following suggestions:</p> <ul> <li>Make sure long-running operations can be cancelled by setting a flag in your add-in or calling some sort of cancellation callback.</li> <li>Avoid keeping idle threads running (when the work is done, the thread's main function should return and the thread will stop running).</li> <li>If you can't stop the add-in, you can notify the user that changes will be applied the next time Visual Studio is restarted. The <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivsuishell.showmessagebox.aspx" rel="nofollow"><code>IVsUIShell.ShowMessageBox</code></a> method is probably what you want to use for this notification.</li> <li>I have not used it before, but it appears the <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivsthreadedwaitdialogfactory.aspx" rel="nofollow"><code>IVsThreadedWaitDialogFactory</code></a> provided by the Visual Studio shell was created for addressing some issues in this space.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload