简体   繁体   English

使用NuGet包资源管理器工具发布具有多个VSIX的Nuget包

[英]Publishing Nuget Packages with multiple VSIX using NuGet Package Explorer Tool

I have a number of VSIXs for a product of mine that I would like to distribute as a Single Nuget package. 对于我的产品,我有很多VSIX,我希望将它们作为Single Nuget软件包进行分发。 There are 3 separate Visual Studio 2013 packages that I only wish to distribute to VS 2013 IDE's (won't run in earlier versions of VS). 我只希望将3个单独的Visual Studio 2013软件包分发给VS 2013 IDE(不会在VS的早期版本中运行)。

I have registered on Nuget and I have downloaded the NuGet Package Explorer where I entered in all the meta data for my package. 我已经在Nuget上注册,并下载了NuGet软件包资源管理器,在其中输入了软件包的所有元数据。

I added a VSIX folder to my Package contents called VSIX and added my three VSIX extensions. 我在包内容中添加了一个VSIX文件夹,称为VSIX,并添加了三个VSIX扩展名。

I published the package and although I am able to search and run my NuGet package from within Visual Studio, it does not seem to run the VSIX extensions. 我发布了该软件包,尽管我可以从Visual Studio中搜索并运行NuGet软件包,但它似乎没有运行VSIX扩展。

I notice when I click on any of my vsix files within NuGet Package Explorer it says that * The format of this file is not supported. 我注意到,当我在NuGet软件包资源管理器中单击任何vsix文件时,它会显示*该文件的格式不受支持。 * *

How do I deploy my extensions via Nuget packages? 如何通过Nuget软件包部署扩展?

Any assistance would be awesome! 任何帮助都将非常棒!

Cheers 干杯

You need to put you VSIX-files into 'tools' folder of your package. 您需要将VSIX文件放入包的'tools'文件夹中。 Then you have to create init.ps1 or install.ps1 to kick the installation process of vsix. 然后,您必须创建init.ps1或install.ps1才能启动vsix的安装过程。 Please note that install.ps1 will not be called for 'solution wide packages' (ie packages which have no content or lib folder). 请注意,“解决方案范围的软件包”(即没有内容或lib文件夹的软件包)将不会调用install.ps1。 So if your package has only 'tools' folder you'll have to put installation logic into init.ps1. 因此,如果您的软件包只有“ tools”文件夹,则必须将安装逻辑放入init.ps1中。 But init.ps1 will be called every time you open your solution in VS. 但是,每次在VS中打开解决方案时都会调用init.ps1。 This is a breaking change NuGet team made in NuGet 2.6 or 2.7 (I don't remember exacly). 这是NuGet团队在NuGet 2.6或2.7中所做的一项重大更改(我不记得很清楚)。 So now putting installation login into init.ps1 isn't a good idea anymore :( 所以现在将安装登录名放入init.ps1不再是一个好主意:(

Installation script could look like this: 安装脚本如下所示:

param($installPath, $toolsPath, $package, $project)

if (-not $toolsPath) { throw "toolsPath parameter wasn't specified" }

if ($dte.Version -eq "10.0") {
    $vsixFileName = "MyExtensiion.vs2010.vsix"
} elseif ($dte.Version -eq "11.0") {
    $vsixFileName = "MyExtensiion.vs2012.vsix"
} else {
    $vsixFileName = "MyExtensiion.vs2013.vsix"
}

$vsxInstaller = [System.IO.Path]::Combine($toolsPath, $vsixFileName)
Start-Process -FilePath $vsxInstaller 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用nuget程序包自动配置VSIX的Visual Studio - configure visual studio with nuget package, VSIX automatically 在 .netcore 中使用同一个 nuget 包的多个版本 - Using multiple versions of the same nuget package in .netcore 如何让 NuGet package 恢复以处理存储在 VSIX 中针对 Visual Studio 2019 的本地部署包? - How do you get NuGet package restore to work on locally deployed packages stored in VSIX targeting Visual Studio 2019? 显示在解决方案资源管理器中使用.targets文件添加的NuGet包项目 - Showing NuGet package item added using .targets file in Solution Explorer 无法使用 Visual Studio NuGet 包管理器控制台安装包 - Cannot install packages using Visual Studio NuGet Package Manager Console Nuget 管理器未使用 package 管理器从 Internet 安装软件包 - Nuget manager not installing packages from internet using package manager 安装多个NuGet软件包错误 - Install multiple NuGet packages error 如何在不使用Nuget UI或命令行工具的情况下手动更新Nuget软件包 - How to manually update a Nuget package without using the Nuget UI or command line tool 一次安装多个NuGet包 - Install multiple NuGet packages at once 如何使用新的 csproj 方法在 nuget 包中分发字体来创建 nuget 包? - How do I distribute a font in a nuget package using the new csproj approach to create nuget packages?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM