Search code examples
.net-standardappveyor

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


I started playing around with AppVeyor this weekend. After some other issues I solved, I am currently stuck at version patching.

What I am trying to achieve: My normal master branch should version everything like 1.0.{build}, which is working fine. But when it comes to the dev branch, every build (or lets say the nuget package) should include something like an "-alpha" suffix.

This is my current Appveyor.xml. It's currently committed to the root of my dev-Branch, the master branch currently has no xml, I want to fix this first.

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)'

Why are my projects not getting patched? Well, I don't know if they're really not patched, but why is the endresult, that my dev-builds packages don't have the versions I specified above? Is there something I am missing? Maybe in my csproj-files or something like that?

You can find my projects dev-branch here - https://github.com/janniksam/Kinoheld/tree/dev - Feel free to check it out, in case you need more information than the xml above.

Update:\

In case you wonder: I did not set the "Ignore appveyor.yml". And I see the lines Patching .NET Core .csproj files in the console.


Solution

  • I finally found the solution. When it comes to finding projects, Appveyor searches for the property <Version> inside your project. My project had no <Version> declared.