AppVeyor 的 .NET Core .csproj 补丁没有任何影响

AppVeyor's .NET Core .csproj patching does not have any affect

这个周末我开始玩 AppVeyor。在我解决了一些其他问题后,我目前停留在版本补丁中。

我想要达到的目标: 我正常的 master 分支应该像 1.0.{build} 一样对所有内容进行版本控制,它工作正常。但是当涉及到开发分支时,每个构建(或者说 nuget 包)都应该包含类似“-alpha”的后缀。

这是我现在的Appveyor.xml。目前提交到我的dev-Branch的root,master分支目前没有xml,我想先解决这个问题。

version: 1.0.{build}
image: Visual Studio 2017
configuration: Release
platform: Any CPU
dotnet_csproj:
  patch: true
  file: '**\*.csproj'
  version: '{version}'
  package_version: '{version}'
  assembly_version: '{version}'
  file_version: '{build}'
  informational_version: '{version}'
before_build:
- cmd: dotnet restore Kinoheld.Api.Client\Kinoheld.Api.Client.sln
build:
  verbosity: minimal
after_build:
- cmd: dotnet pack Kinoheld.Api.Client\Kinoheld.Api.Client\Kinoheld.Api.Client.csproj
artifacts:
- path: '**\*.nupkg'
deploy: off

for:
-
  branches:
    only:
      - dev

  dotnet_csproj:
    patch: true
    file: '**\*.csproj'
    version: '{version}-alpha'
    package_version: '{version}-alpha'
    assembly_version: '{version}'
    file_version: '{version}'
    informational_version: '{version} (pre-release)'

为什么我的项目没有得到修补?好吧,我不知道它们是否真的没有打补丁,但为什么最终结果是我的 dev-builds 包没有我上面指定的版本?有什么我想念的吗?也许在我的 csproj 文件或类似文件中?

你可以在这里找到我的项目 dev-branch - https://github.com/janniksam/Kinoheld/tree/dev - 如果您需要比上述 xml 更多的信息,请随时查看。

更新:\

如果您想知道:我 没有 设置 "Ignore appveyor.yml"。我在控制台中看到 Patching .NET Core .csproj files 行。

我终于找到了解决办法。在查找项目时,Appveyor 会在您的项目中搜索 属性 <Version>。我的项目没有 <Version> 声明。