I've got a VSIX extension. I decided to try to upgrade to the latest version of Visual Studio (2019), and see what kind of horrors that I would encounter this time in getting my extension to work with the latest version. I read the article by Mads Kristensen
about upgrading VSIX extensions:
https://devblogs.microsoft.com/visualstudio/author/madsk/
I was lulled into a false sense of optimism by that. I feel so foolish.
I made the changes to my .vsixmanifest as mentioned in the article. I then built the VSIX project with Visual Studio 2019. When I tried to load the VSIX, it did not find Visual Studio 2019. I got a message box with the following message:
"This extension is already installed to all applicable products."
After much Googling, I eventually unzipped the VSIX file, and examined the extension.vsixmanifest file within the generated VSIX. To my astonishment and dismay, the "Version" attributes on the "InstallationTarget" elements had been changed
back to what they were before (16.0, instead of 17.0):
<Installation>
<!-- <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0]" /> -->
<!-- Verification entry to ensure that this is the source file. -->
<InstallationTarget Version="[14.0,16.0)" Id="Microsoft.VisualStudio.Community" />
<InstallationTarget Version="[14.0,16.0)" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[14.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
<InstallationTarget Version="[15.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" />
</Installation>
I then examined the extension.vsixmanifest file within the bin folder. It is as it should be, and as it is when I edited it:
<Installation>
<!-- <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0]" /> -->
<!-- Verification entry to ensure that this is the source file. -->
<InstallationTarget Version="[14.0,17.0)" Id="Microsoft.VisualStudio.Community" />
<InstallationTarget Version="[14.0,17.0)" Id="Microsoft.VisualStudio.Pro" />
<InstallationTarget Version="[14.0,17.0)" Id="Microsoft.VisualStudio.Enterprise" />
<InstallationTarget Version="[15.0,17.0)" Id="Microsoft.VisualStudio.Enterprise" />
</Installation>
It would appear that it was changed by something within the build process.
I then edited the extension.vsixmanifest within the unzipped file to what it should be (Version="[14.0,17.0)"), re-zipped the folder into a VSIX, and it loaded to Visual Studio 2019.
I can invoke functions within my VSIX that do not alter text. I thought to myself: "OK - so far, so good."
I then invoked a function that alters test: It's a simple function that duplicates the current line that the cursor is on, much like the function on CTRL+D in Resharper. I had an "OH SHIT" moment when Visual Studio 2019 froze, and I saw a message
at the top:
"One or more extensions were loaded using deprecated APIs."
My VSIX extension started out as macros, which were originally written over 10 years ago. A lot of the functions are based on EnvDTE objects. I have a bad feeling that this is the API that has been deprecated. Am I correct? If so, what can I do about getting
EnvDTE functionality incorporated into Visual Studio 2019? If not, how can I find out what it is that Visual Studio 2019 does not like?
<rant>
As I stated before: My VSIX extension started out as macros many years ago. I was one of many who were PO'ed when Microsoft removed macro support from Visual Studio. I then managed to get everything loaded as an add-in, then had the rug pulled out from under
me when Microsoft did away with add-ins on later versions. I then managed to get everything to load as a VSIX, turning the code files from my macros into libraries upon which I call functions from the VSIX, and everything was working well with Visual Studio
2015 and 2017. It seems like, with every new version, I have to endure anguish and misery just to keep the same functionality that I had from over 10 years ago.
</rant>
Any assistance with this would be much appreciated.
Wally