How to open readme URL for NuGet package?

白昼怎懂夜的黑 提交于 2020-01-01 05:17:27

问题


In NuGet, you can put a readme.txt in the root of the pacakge and it will open automatically. However, I have seen NuGet packages open a URL upon installation. How is this done (you can see an example with this NuGet package).


回答1:


It is done through a PowerShell script in the package's tools\install.ps1 file. Download the Glimpse package package, extract the archive, look for the tools\install.ps1 file.

At the bottom, you'll find the following script which performs the navigation:

$DTE.ItemOperations.Navigate("http://getglimpse.com/Version/Install/?" + $package.Id + "=" + $package.Version)



回答2:


You need to add a powershell script to your package:

  • Init.ps1 runs when you first install a package into a solution
  • Install.ps1 runs every time a package is installed into a project.

Source: http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Automatically_Displaying_a_Readme.txt_File_During_Package_Installation



来源:https://stackoverflow.com/questions/15401521/how-to-open-readme-url-for-nuget-package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!