6

I was wondering if the VSTO works on the new .NET Core 3 which supports COM Objects. A Project can be created with .Net Framework and then migrate it to .NET Core by modifying the .csproj file, but will be the VSTO compatible ? If not, is there an alternative to the VSTO in .NET Core 3 ?

Aziz Khalledi
  • 63
  • 1
  • 4
  • VSTO is used to create "native" addins and those run on the runtime provided by the Office application that runs them. That's .NET Framework. Given the new [Office Addin architecture](https://learn.microsoft.com/en-us/office/dev/add-ins/overview/office-add-ins) based on Javascript,I doubt VSTO will ever support .NET Core. – Panagiotis Kanavos Dec 06 '19 at 11:22
  • Is VSTO going to continue in .NET? – Doug Kimzey Jul 11 '20 at 16:24

3 Answers3

2

It seems like there is currently no alternative. There is a request to add this support in the future to .Net 5 https://developercommunity.visualstudio.com/idea/757925/please-port-visual-studio-tools-for-office-vsto-to.html

The recommendation currently seems to be using the Office JS platform to create add-ins. These will be compatible across platforms also (https://blogs.msdn.microsoft.com/deva/2018/04/02/office-developer-difference-between-office-web-addin-vs-comvsto-addin)

Bean
  • 61
  • 5
1

VSTO does not currently support .Net core.
But nothing prevents you from creating a pure COM based addin by implementing a COM object that exposes the IDTEXtensibility2 interface.
The question is why do you need to develop an addin using .Net Core alone? Your addin will run on a machine with the Office suite installed, which mean .Net run-time will also be installed.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • There are some scenarios where `.NET Core` functionality may be more useful. For instance, in one of my `VSTO` add-in, I tried using [File.WriteAllTextAsync](https://learn.microsoft.com/en-us/dotnet/api/system.io.file.writealltextasync?view=netcore-2.0) method but it did not work because this method is supported only in `.NET Core 2.0` and later. Sure there are alternatives but a built-in functionality would be a preference. – nam May 21 '20 at 21:55
  • _"The question is why do you need to develop an addin using .Net Core alone? Your addin will run on a machine with the Office suite installed, which mean .Net run-time will also be installed."_ - because .NET Framework 4.8 is dead-end - all new .NET code is written for .NET 5+, so if we want to use a new .NET library with Office we're stuck... it's like buying a fancy new car but being told we still need to keep around our old banger we want to replace because the office building's parking lot is somehow fundamentally incompatible with fancy new cars. – Dai Jul 06 '22 at 17:37
0

Example implementation of and add-in based on .NET 5 (for Visio, with setup on WIX) Should compile, and work.

Adds a single clickable button to the ribbon: https://github.com/nbelyh/VisioComAddinNet5

The steps must be common to all office applications though.

Nikolay
  • 10,752
  • 2
  • 23
  • 51