Skip to content

Assembly attributes are duplicated #1025

@jakubro

Description

@jakubro

Assembly version attributes are not matched when they contain the trailing Attribute postfix. Furthermore attributes are duplicated as shown in example which makes it impossible to compile the solution.

This incorrect behavior occurs when using the command line tool v3.6.1.

Current behavior

Excerpt from AssemblyInfo.cs

[assembly: AssemblyVersionAttribute("1.0.5")]
[assembly: AssemblyFileVersionAttribute("1.0.5")]
[assembly: AssemblyInformationalVersionAttribute("1.0.5")]

After executing GitVersion.exe /updateassemblyinfo this is the resulting AssemblyInfo.cs:

[assembly: AssemblyVersionAttribute("1.0.5")]
[assembly: AssemblyFileVersionAttribute("1.0.5")]
[assembly: AssemblyInformationalVersionAttribute("1.0.5")]

[assembly: AssemblyVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0+0.Branch.master.Sha.6d96beb1cc51db3c0b4c52a42b039741e7463fc9")]
[assembly: AssemblyFileVersion("0.1.0.0")]

Expected behavior

Resulting AssemblyInfo.cs should look like this:

[assembly: AssemblyVersionAttribute("0.1.0.0")]
[assembly: AssemblyFileVersionAttribute("0.1.0+0.Branch.master.Sha.6d96beb1cc51db3c0b4c52a42b039741e7463fc9")]
[assembly: AssemblyInformationalVersionAttribute("0.1.0.0")]

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