2

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.

1
  • Isn't it somewhat strange to patch project files just to specify version information? Can't you execute a custom build step to generate file with required info? Sep 23, 2018 at 10:38

1 Answer 1

6

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.

1
  • 1
    Correct this is an issue describing it. We are still not sure if we should create those properties as some people can find this intrusive. Sep 28, 2018 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.