如何适应 Visual Studio 2019 的扩展?
How adapt extension to Visual Studio 2019?
我了解到为 VS 2019 调整扩展非常容易 - https://devblogs.microsoft.com/visualstudio/visual-studio-extensions-and-version-ranges-demystified/#。
但是如果我执行 post:
中的所有操作,我会出错
It's not possible to install because there is no following links:
Microsoft.VisualStudio.Component.CoreEditor.
post 的作者在调整他的扩展时显示了完全相同的行:
<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 的 post 中所描述的那样。
到目前为止,一切对我来说都很好:-)。
我在将 Visual Studio 扩展从 2017 年向前移植到 2019 年时也 运行 解决了这个问题。
变化是两倍:
- 首先更新“安装目标”运行ge 在“vsixmanifest”文件中。
- 其次,更新先决条件'Microsoft.VisualStudio.Component.CoreEditor'
下面是我更改的清单文件的示例。
Mads Kristensen 的原创 Blog Post 关于正向移植 Visual Studio 从 VS 2017 到 VS 2019 的扩展。
我了解到为 VS 2019 调整扩展非常容易 - https://devblogs.microsoft.com/visualstudio/visual-studio-extensions-and-version-ranges-demystified/#。
但是如果我执行 post:
中的所有操作,我会出错It's not possible to install because there is no following links: Microsoft.VisualStudio.Component.CoreEditor.
post 的作者在调整他的扩展时显示了完全相同的行:
<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 的 post 中所描述的那样。 到目前为止,一切对我来说都很好:-)。
我在将 Visual Studio 扩展从 2017 年向前移植到 2019 年时也 运行 解决了这个问题。
变化是两倍:
- 首先更新“安装目标”运行ge 在“vsixmanifest”文件中。
- 其次,更新先决条件'Microsoft.VisualStudio.Component.CoreEditor'
下面是我更改的清单文件的示例。
Mads Kristensen 的原创 Blog Post 关于正向移植 Visual Studio 从 VS 2017 到 VS 2019 的扩展。