Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

Assembly Patching #5

Open
Knaackee opened this issue Jul 26, 2016 · 8 comments
Open

Assembly Patching #5

Knaackee opened this issue Jul 26, 2016 · 8 comments

Comments

@Knaackee
Copy link

Knaackee commented Jul 26, 2016

Do someone know if Assembly Patching does work? Cant get it work.

Thanks in advance!

@sliekens
Copy link
Owner

No, all assembly info is generated based on what it says in the project.json files. The assembly patching in AppVeyor runs before any assembly info code generation takes place.

@Knaackee
Copy link
Author

Hmm, ok. So does that mean you cant have an auto increment of the verions number besides the version prefix ?

Thanks for your help

@sliekens
Copy link
Owner

sliekens commented Jul 26, 2016

I'm not sure but I think you can control the version info using environment variables

  • DOTNET_BUILD_VERSION: can be used instead of setting --version-suffix on the cmdline
  • DOTNET_ASSEMBLY_FILE_VERSION: has no cmdline equivalent?

It's not clear if DOTNET_BUILD_VERSION should contain only the suffix or the entire version string.

You might try something like this:

ps: $Env:DOTNET_BUILD_VERSION = "1.0.$Env:APPVEYOR_BUILD_NUMBER-CI"
ps: $Env:DOTNET_ASSEMBLY_FILE_VERSION = "1.0.$Env:APPVEYOR_BUILD_NUMBER"

@Knaackee
Copy link
Author

I test that out and report back soon.

@Knaackee
Copy link
Author

I am getting

The assembly file version is invalid: 1.0..51

@sliekens
Copy link
Owner

I forgot that assembly versions have 4 components instead of 3. It's interesting that dotnet parses it as 1.0.<empty>.51.

Try setting all 4 components: 1.0.0.$Env:APPVEYOR_BUILD_NUMBER

@Knaackee
Copy link
Author

already tried it with no luck :)

I found where the exception happend

https://github.com/borgdylan/dotnet-cli/blob/master/src/Microsoft.DotNet.ProjectModel/ProjectReader.cs#L139

@sliekens
Copy link
Owner

sliekens commented Sep 6, 2016

@dknaack did you figure out a solution?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants