Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a Visual Studio Extension with .Net Core

By default, Visual Studio 2022 Extension (Add-in) Project is on .Net Framework (not .Net 5 or 6). When I manually .csproj > PropertyGroup > TargetFramework XML value to net5.0, I run into a compile error.

Some of my projects are made with .Net 5 and it cannot be built with multiple targets (i.e. both .Net 5 and .Net Framework), which are needed to be referenced by my Visual Studio Extension project. Unfortunately, a .Net Framework project cannot reference a .Net 5 project, on the other hand, the vice versa can be partially available.

Is there any way of making Visual Studio Extensions with .Net 5 or later? If it cannot be done, how can I have my Visual Studio Extension project reference a .Net 5 based libraries(.dll)?

like image 640
Hyunjik Bae Avatar asked Sep 20 '25 10:09

Hyunjik Bae


1 Answers

Visual Studio is adding support for out-of-process extensions, meaning that they run in a separate process from Visual Studio's main devenv.exe process, which runs on .NET Framework 4.x. That means the extension can be written using other technologies, such as .NET 6.

  • Blog post: https://devblogs.microsoft.com/visualstudio/the-future-of-visual-studio-extensibility-is-here/
  • Write your first extension: https://github.com/microsoft/VSExtensibility/blob/main/docs/new-extensibility-model/getting-started/create-your-first-extension.md
  • Out-of-proc extensibility: https://github.com/microsoft/VSExtensibility/blob/main/docs/new-extensibility-model/getting-started/oop-extensibility-model-overview.md
  • Out-of-proc UI: https://github.com/microsoft/VSExtensibility/blob/main/docs/new-extensibility-model/inside-the-sdk/remote-ui.md
like image 59
Eilon Avatar answered Sep 23 '25 13:09

Eilon