I am creating an extension for similar functionality that we had as an addin.
When I debug the extension, and the experimental instance of VS is opened, I get this:
ContextSwitchDeadlock occurred Message: Managed Debugging Assistant 'ContextSwitchDeadlock' has detected a problem in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe'. Additional information: The CLR has been unable to transition from COM context 0x1272878 to COM context 0x12727c0 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
I read this post: Similar problem
and unchecked the ContextSwitchDeadlock from the Exception Settings, but I didn't feel comfortable with that.
Then I found this post (particularly Scott Munro's answer): Similar problem 2
and used the steps to get to the Thread window, but on examining the Main thread I only see this:
Main Thread Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.ResourceLoader.FindResource.AnonymousMethod__0
[External Code]
So that doesn't help me much.
How do I solve the ContextSwitchDeadlock? Apart from simply unchecking it in the MDA. I have also tried to install the published vsix (not uploaded to the gallery) on my computer, but it made VS hang on the splashscreen. I assume it is related to this whole issue.
This is what the main thread shows (row column transformation):
Main Thread
Main Thread Microsoft.VisualStudio.CommonIDE.dll!Microsoft.VisualStudio.CommonIDE.ResourceLoader.OpenAssemblyResourceManifest4
Normal
And this is what the Worker thread that complains shows:
Worker Thread clr.dll!Thread::intermediateThreadProc()
ntdll.dll!_NtWaitForSingleObject@12 Normal
I can't see anything in the callstack, or find what my code is busy with.