Skip to content

[Question] Can GitVersionTask be configured to only update specified Assembly*Versions and not others #1319

@kbatman37

Description

@kbatman37

Looking at the documentation for GitVersion, it appears that there are options for only allowing GitVersion to set certain version while allowing others to stay under manual control. As an example, I would like to update the AssemblyFileVersion but not the AssemblyVersion. I have tried adding the following to my csproj file

<PropertyGroup>
    <UpdateAssemblyInfo>true</UpdateAssemblyInfo>
    <GenerateAssemblyFileVersionAttribute>true</GenerateAssemblyFileVersionAttribute>
    <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
    <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
  </PropertyGroup>

and have updated my AssemblyInfo.cs file

[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

but I still end up with both versions being set to 1.0.0.0.

Is this type of configuration possible using GitVersionTask? I can not find any good examples or clear documentation showing this type of setup. but I do see references here in the documentation that indicate something like this may be possible.

PS: sorry if this is the wrong place for this type of question. I will happily move it if you point me someplace more appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions