Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How adapt extension to Visual Studio 2019?

I read that adapting of extension for VS 2019 is quite easy - https://devblogs.microsoft.com/visualstudio/visual-studio-extensions-and-version-ranges-demystified/#.

But I got an error if I do all the actions from the post:

It's not possible to install because there is no following links: Microsoft.VisualStudio.Component.CoreEditor.

The author of the post shows the exactly same row when he adapts his extensions:

<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,)" />

So it seems that this prerequisite was not a problem for him.

My updated extension.vsixmanifest is:

<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011">
  <Metadata>
    <Identity Id="PowerQuerySDK.Microsoft.30831070-f420-4649-a031-6f679996b182" Version="1.0.0.20" Language="en-US" Publisher="Microsoft" />
    <DisplayName>Power Query SDK</DisplayName>
    <Description xml:space="preserve">A Power Query language service for Visual Studio</Description>
    <License>Microsoft Power Query SDK - Pre-Release or Evaluation Use Terms.rtf</License>
    <Icon>dataconnector_128.png</Icon>
    <PreviewImage>EATIcon.ico</PreviewImage>
  </Metadata>
  <Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0,17.0)" />
    <InstallationTarget Version="[14.0,17.0)" Id="Microsoft.VisualStudio.Pro" />
    <InstallationTarget Version="[14.0,17.0)" Id="Microsoft.VisualStudio.Enterprise" />
  </Installation>
  <Dependencies>
    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" Version="[4.5,)" />
  </Dependencies>
  <Assets>
    <Asset Type="Microsoft.VisualStudio.ProjectTemplate" Path="ProjectTemplates" />
    <Asset Type="Microsoft.VisualStudio.ItemTemplate" Path="ProjectTemplates" />
    <Asset Type="Microsoft.VisualStudio.VsPackage" Path="Dependencies\Microsoft.Mashup.Tools.VisualStudio.pkgdef" />
    <Asset Type="Microsoft.VisualStudio.MefComponent" Path="Dependencies\Microsoft.Mashup.Tools.VisualStudio.dll" />
  </Assets>
  <Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,)"  />
  </Prerequisites>
</PackageManifest>

Please could you say what may be the workaround for the problem?

like image 432
Andrey Minakov Avatar asked Mar 09 '19 22:03

Andrey Minakov


People also ask

How do I import extensions into Visual Studio?

You can install extensions from Visual Studio Marketplace or the Manage Extensions dialog box in Visual Studio. To install extensions from within Visual Studio: From Extensions > Manage Extensions, find the extension you want to install.

How do I activate VS extensions?

You can browse and install extensions from within VS Code. Bring up the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of VS Code or the View: Extensions command (Ctrl+Shift+X).

How can I transfer from 2019 to 2022?

NET Core and Migrate from ASP . For migrating from VS 2019 to VS 2022 you can refer to this document: Project migration and upgrade reference for Visual Studio. In case you meet compatibility issues, don't worry, report the issues on Developer Community and VS product team will help to fix the potential issue.


2 Answers

I found the solution for the problem. It is in catalog.json file inside PowerQuerySdk.vsix file. You should change part of the file from:

"Microsoft.VisualStudio.Component.CoreEditor":"[15.0,16.0)"}

to:

"Microsoft.VisualStudio.Component.CoreEditor":"[15.0,17.0)"}

. I didn't suspect that the mention of CoreEditor may be in this file. But obviously you should change the version of MSBuild to 17, just as you should do in extension.vsixmanifest, as it is described in the post of Mads Kristensen above. Up to now all works fine for me :-).

like image 192
Andrey Minakov Avatar answered Oct 10 '22 20:10

Andrey Minakov


I also ran into this issue while porting a Visual Studio Extension forward from 2017 to 2019.

The change was 2-fold:

  • Firstly updating the 'Installation Target' range in the 'vsixmanifest' file.
  • Secondly, updating the Prerequisite 'Microsoft.VisualStudio.Component.CoreEditor'

Below is an example of the Manifest file I changed.

Pull Request

Mads Kristensen's original Blog Post on forward porting Visual Studio Extensions from VS 2017 to VS 2019.

like image 1
Michael Murphy Avatar answered Oct 10 '22 22:10

Michael Murphy