Skip to content

UpdateAssemblyInfo target should not be run for SDK-style projects #2182

@bording

Description

@bording

The UpdateAssemblyInfo target is currently always being run, even for SDK-style projects that don't need it. The SDK-style project system handles that automatically as long as the appropriate properties have been set. This is already happening in the GetVersion target.

This behavior used to work correctly, and you can even see a comment in the GitVersionTask.props file indicating that this was the behavior.

This appears to have been broken in the 5.0.0 release, but fixing #2167 in 5.2.3 brought it to my attention because that change broke one of my projects.

Expected Behavior

The UpdateAssemblyInfo target should not be run when using an SDK-style project.

Actual Behavior

The UpdateAssemblyInfo target should not be run when using an SDK-style project.

Possible Fix

Add a condition to the UpdateAssemblyInfo property in GitVersionTask.props that disables the UpdateAssemblyInfo when the UsingMicrosoftNETSdk property is true.

Steps to Reproduce

Context

I have an SDK-style project that is using the MSBuild.Sdk.Extras SDK to build a WPF app, and using 5.2.3 is causing a build error because of duplicate version attributes from GitVersion trying to create them instead of letting the project system do it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions