How adapt extension to Visual Studio 2019?
Asked Answered
D

2

6

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?

Dynamiter answered 9/3, 2019 at 22:38 Comment(1)
Btwn - I opened an issue for Power Query SDK regarding the problem. Please show your opinion here - github.com/Microsoft/DataConnectors/issues/197 It seems that the problem takes place particularly with PQ SDK, so it's possible we'll wait for a while for fixing the issue, if we do not express that we need the fix urgently.Dynamiter
D
8

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 :-).

Dynamiter answered 14/3, 2019 at 21:16 Comment(0)
S
1

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.

Systematism answered 6/5, 2019 at 8:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.