【发布时间】:2012-05-22 09:19:56
【问题描述】:
【问题讨论】:
【问题讨论】:
您只需指定使用 SemVer 格式(例如 1.0-beta)而不是通常格式(例如 1.0)的版本字符串,NuGet 会自动将其视为预发布包。
“从 NuGet 1.6 开始,NuGet 支持通过根据语义版本控制 (SemVer) 规范在版本号中指定预发布字符串来创建预发布包。” See NuGetDocs - Prerelease Versions
【讨论】:
此外,如果版本号低于稳定版本,则不会显示预发布版本。例如,如果您有
只有稳定版本会出现在列表中。
如果你有
可以安装预发布版本。
【讨论】:
只需将“-alpha”或“-beta”添加到您的.nuspec 文件的version 键即可。这会将您的客户端发布为预发布版本。
重要提示:假设您要测试一个版本7.6.6.4,那么您可以在7.6.6.4-alpha 中添加-alpha。避免在您已经发布的版本中添加-alpha,例如:7.6.6.3-alpha
示例:
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>AnalyticalService.Client</id>
<version>7.6.6.4-alpha</version>
<title>.net client for Analytical Service</title>
<authors>Kushal Seth</authors>
<owners>Kushal Seth</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Alpha version for events integration</description>
<summary>Alpha version for events integration</summary>
<dependencies>
<dependency id="EntityFramework" version="6.1.3" />
<dependency id="Newtonsoft.Json" version="11.0.2" />
<dependency id="System.Net.Http" version="4.0.0" />
<dependency id="System.Net.Http.Formatting.Extension" version="5.2.3" />
<dependency id="WindowsAzure.Storage" version="9.3.3" />
<dependency id="Polly" version="7.1.0" />
<dependency id="Microsoft.Azure.KeyVault.Core" version="1.0.0" />
<dependency id="NETStandard.Library" version="1.6.1" />
<dependency id="Microsoft.NETCore.Platforms" version="1.1.0" />
</dependencies>
</metadata>
<files>
<file src="E:\service\AnalyticalService\src\AnalyticalService.Client\bin\Release\AnalyticalService.Client.dll" target="lib\AnalyticalService.Client.dll" />
<file src="E:\service\AnalyticalService\src\AnalyticalService.Client\bin\Release\AnalyticalService.Model.dll" target="lib\AnalyticalService.Model.dll" />
</files>
</package>
要在 Nuget 包管理器中检查您发布的包,您必须选中此复选框:(我使用的是 VS 2019 Professional 16.8 版本,您的 VS 版本中可能有类似的选项)
【讨论】: