我读到适应VS 2019的扩展非常容易 - https://devblogs.microsoft.com/visualstudio/visual-studio-extensions-and-version-ranges-demystified/#。
但如果我从帖子中执行所有操作,我会收到错误:
无法安装,因为没有以下链接:Microsoft.VisualStudio.Component.CoreEditor。
该帖子的作者在调整其扩展时显示完全相同的行:
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,)" />
所以看来这个先决条件对他来说不是问题。
我更新的extension.vsixmanifest是:
<?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>
请问您能说出问题的解决方法是什么?
我找到了问题的解决方案。它位于PowerQuerySdk.vsix文件中的catalog.json文件中。您应该从以下位置更改文件的一部分:
"Microsoft.VisualStudio.Component.CoreEditor":"[15.0,16.0)"}
至:
"Microsoft.VisualStudio.Component.CoreEditor":"[15.0,17.0)"}
。我没有怀疑提到CoreEditor可能在这个文件中。但显然你应该将MSBuild的版本更改为17,就像你应该在extension.vsixmanifest中那样,正如Mads Kristensen上面的帖子所描述的那样。到目前为止,所有对我来说都很好:-)。
我还在从2017年到2019年移植Visual Studio Extension时遇到了这个问题。
变化是2倍:
下面是我更改的清单文件的示例。
Mads Kristensen的原始Blog Post将Visual Studio Extensions从VS 2017向前移植到VS 2019。