Closed bording closed 4 years ago
@bording is this related or duplicate of https://github.com/GitTools/GitVersion/issues/2181
@arturcic It's definitely related, but I'm not sure I'd call it a duplicate. Looks like #2181 is reporting a symptom of the regression that I'm reporting here.
:tada: This issue has been resolved in version 5.2.4 :tada: The release is available on:
Your GitReleaseManager bot :package::rocket:
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 theGetVersion
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 theUpdateAssemblyInfo
when theUsingMicrosoftNETSdk
property istrue
.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.