【问题标题】:How to specify commit and branch in csproj for nuget package creation如何在 csproj 中指定提交和分支以创建 nuget 包
【发布时间】:2019-07-30 20:16:54
【问题描述】:

所以目前您可以配置分支并提交 .nuspec(请参阅reference):

<repository type="git" 
            url="https://github.com/NuGet/NuGet.Client.git" 
            branch="dev" 
            commit="e1c65e4524cd70ee6e22abe33e6cb6ec73938cb3" />

但是我们如何从 SDK 样式的 .csproj 文件中配置它呢?目前我有类型和网址:

<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/NLog/NLog.git</RepositoryUrl>

我找不到“分支”和“提交”的正确元素或属性。它也不在此页面上:MSDN - Additions to the csproj format for .NET Core

那么在从 sdk 样式的 csproj 创建 nuget 包时,我该如何配置分支和提交?

【问题讨论】:

    标签: nuget-package csproj nuspec


    【解决方案1】:

    您要查找的属性如下:

    <RepositoryUrl>https://github.com/your/repository.git</RepositoryUrl>
    <RepositoryBranch>release2.2</RepositoryBranch> <!-- optional branch reference -->
    <RepositoryCommit>24ca19c71e8a84eeb8b9d3f95faa4b244db4341b</RepositoryCommit> <!-- optional commit reference -->
    

    请注意,这些只是添加到包元数据中,您仍然只能构建本地拥有的任何内容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-02
      • 1970-01-01
      • 2012-02-20
      • 2011-11-10
      • 2021-10-15
      • 1970-01-01
      相关资源
      最近更新 更多