Add AssemblyInformationalVersion attribute to AssemblyInfo.cs when missing.

sebastian's Avatar


25 Apr, 2015 07:58 AM

I'm using GitVersion to generate my build version numbers for assemblies, nuget packages etc.

A part of the process is to set the AssemblyInformationVersion attribute to the NuGet package version so that the $version$ field in NuSpec is given the correct (NuGet compatible) version.

This set up is pretty much perfect, except that it requires me to add AssemblyInformationalVersion to each AssemblyInfo.cs in each project I'm packaging for NuGet. Not a big deal at all, but this is exactly the kind of tiny detail that I would forget for new projects and spend 4 hours tearing my hair out over before figuring it out again. It would be handy if AppVeyor could insert this attribute if the build has an InformationalVersion defined.

Just an idea :)

  1. 1 Posted by sebastian on 25 Apr, 2015 09:11 AM

    sebastian's Avatar

    Actually to be honest, the 'perfect' solution would be to be able to put the full GitVersion_InformationalVersion variable as the AssemblyInformationalVersion, and somehow tell AppVeyor to use the 'GitVersion_NuGetVersion' variable for the NuGetPackages instead of reading AssemblyInformationalVersion.

    But then I'd have to manually call a 'nuget pack' for each project, wouldn't I? Ideally, I would be able to specify what version to use for the automatic 'nuget pack' step.

  2. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:55 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac