本文介绍了如何为Visual Studio Build Tools 2017创建扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为Visual Studio Build Tools 2017创建扩展名(VSIX?)。

该扩展只包含MSBuild任务和目标。



----命令行----

vsixinstaller / appidInstallPath:" C:\Program Files(x86)\ Microsoft Visual Studio \\\ 2017 \ BuildTools" / appIdName:"构建工具" / s:BuildTools /v:15.0 MyMSBuild.vsix

----------------------


-------- log ---------
$
2018/02/16 17:25:20 - System.InvalidOperationException:VSHiveStub.exe失败:PkgdefManagement失败创建应用程序:"0x80030002"。

  在VSIXInstaller.LocationBasedSKU.get_RegRootHiveOverride()

  在VSIXInstaller.SupportedVSSKU.InitializeSettingsManager()

  在VSIXInstaller.SupportedVSSKU.get_Host()

  在VSIXInstaller.SupportedVSSKU.CreateExtensionEngine()

  在System.Lazy`1.CreateValue()

  在System.Lazy`1.LazyInitValue()

  在System.Lazy`1.get_Value()

  在VSIXInstaller.App.GetExtensionEngineForApplicableSKU(SupportedVSSKU supportedSKU,IInstallableExtension installableExtension,List`1 applicableSKUs,Boolean isRepairSupported)

  在VSIXInstaller.App.GetInstallableData(String vsixPath,Boolean isRepairSupported,IEnumerable`1& skuData)

  在VSIXInstaller.App.Initialize(Boolean isRepairSupported)

  在VSIXInstaller.App.Initialize()

  在System.Threading.Tasks.Task`1.InnerInvoke()

  在System.Threading.Tasks.Task.Execute()

----------------------


---- vsixmanifest ----

<?xml version =" 1.0" encoding =" utf-8"?>

< PackageManifest Version =" 2.0.0" xmlns =" " ; xmlns:d =" ">

  <元数据>

    < Identity Id =" MyMSBuild"版本= QUOT; 1.0.0.0"语言=" EN-US"出版商= QUOT; XXXXX" />
$
    < DisplayName> MSBuild支持< / DisplayName>

    <描述xml:space ="保留"> MSBuild支持。< / Description>

    < Icon> Resources\Package.ico< / Icon>

  < /元数据>

  < Installation InstalledByMsi =" false" AllUsers =" true">

    < InstallationTarget Id =" Microsoft.VisualStudio.BuildTools"版本= QUOT; [15.0,16.0)" />

  < /安装>

  <依赖关系>

    < Dependency Id =" Microsoft.Framework.NDP" DisplayName =" Microsoft .NET Framework" d:源= QUOT;手动"版本= QUOT; [4.6,)" />

  < / Dependencies>

  <资产>

  < / Assets>

  <先决条件>

    <先决条件Id =" Microsoft.Component.MSBuild"版本= QUOT; [15.0,16.0)"显示名称= QUOT;&的MSBuild QUOT; />

  < /先决条件>

< / PackageManifest>

----------------------


如何为Build Tools创建扩展?


解决方案

I would like to create the extension (VSIX?) for Visual Studio Build Tools 2017.
That extension contains only MSBuild tasks and targets.

VSIXInstaller returned the error though I created VSIX for Build Tools by the VSIX project and tried installing:

---- command line ----
vsixinstaller /appidInstallPath:"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools" /appIdName:"Build Tools" /s:BuildTools /v:15.0 MyMSBuild.vsix
----------------------

-------- log ---------
2018/02/16 17:25:20 - System.InvalidOperationException: VSHiveStub.exe failed: PkgdefManagement failed to create application: "0x80030002".
   at VSIXInstaller.LocationBasedSKU.get_RegRootHiveOverride()
   at VSIXInstaller.SupportedVSSKU.InitializeSettingsManager()
   at VSIXInstaller.SupportedVSSKU.get_Host()
   at VSIXInstaller.SupportedVSSKU.CreateExtensionEngine()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at VSIXInstaller.App.GetExtensionEngineForApplicableSKU(SupportedVSSKU supportedSKU, IInstallableExtension installableExtension, List`1 applicableSKUs, Boolean isRepairSupported)
   at VSIXInstaller.App.GetInstallableData(String vsixPath, Boolean isRepairSupported, IEnumerable`1& skuData)
   at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
----------------------

---- vsixmanifest ----
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
  <Metadata>
    <Identity Id="MyMSBuild" Version="1.0.0.0" Language="en-US" Publisher="XXXXX" />
    <DisplayName>MSBuild Support</DisplayName>
    <Description xml:space="preserve">MSBuild Support.</Description>
    <Icon>Resources\Package.ico</Icon>
  </Metadata>
  <Installation InstalledByMsi="false" AllUsers="true">
    <InstallationTarget Id="Microsoft.VisualStudio.BuildTools" Version="[15.0,16.0)" />
  </Installation>
  <Dependencies>
    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.6,)" />
  </Dependencies>
  <Assets>
  </Assets>
  <Prerequisites>
    <Prerequisite Id="Microsoft.Component.MSBuild" Version="[15.0,16.0)" DisplayName="MSBuild" />
  </Prerequisites>
</PackageManifest>
----------------------

How can I create extension for Build Tools?

解决方案


这篇关于如何为Visual Studio Build Tools 2017创建扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 02:15