visual-studio-extensions

Missing reference to 'Microsoft.VisualStudio.Threading' assembly


I am following this tutorial for creating a custom Visual Studio extension. I just installed the Visual Studio extension development workload, and I'm using Visual Studio 2022 version 17.12.

I just finished the step Add a custom command and I'm trying to fix compilation errors. One says I'm missing a reference to 'Microsoft.VisualStudio.Threading' assembly, but I don't have that one when clicking on Project > Add Reference.

enter image description here

How do I fix this error? I am completely new to extension developement.


Solution

  • If you want to add a reference to Microsoft.VisualStudio.Threading assembly, you can navigate to "Tools->Nuget package Manager" and install this package. enter image description here

    BTW, i have followed the tutorial you referenced above and can successfully run it. And i checked the references in .csproj file but not found Microsoft.VisualStudio.Threading referenced by default. Please check your project file and run dotnet restore to restore the missing packages.