Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bording opened this issue Mar 16, 2020 · 3 comments · Fixed by #2183
Closed

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

bording opened this issue Mar 16, 2020 · 3 comments · Fixed by #2183
Labels
Milestone

Comments

@bording
Copy link
Contributor

bording commented Mar 16, 2020

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.

@bording bording added the bug label Mar 16, 2020
@arturcic
Copy link
Member

arturcic commented Mar 16, 2020

@bording is this related or duplicate of #2181

@bording
Copy link
Contributor Author

bording commented Mar 16, 2020

@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.

@arturcic arturcic added this to the 5.2.4 milestone Mar 16, 2020
@github-actions
Copy link

🎉 This issue has been resolved in version 5.2.4 🎉
The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants