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

RemoveAllProperties or other way to ensure single-instanced "utility" project builds #11390

Open
rainersigwald opened this issue Feb 4, 2025 · 1 comment
Labels
Area: Language Issues impacting the MSBuild programming language. Priority:2 Work that is important, but not critical for the release triaged

Comments

@rainersigwald
Copy link
Member

(inciting incident is microsoft/MSBuildSdks#601 (comment) but we've had this thought for a long time)

By default, global properties for the current project flow to projects built with the MSBuild task, unless overridden or explicitly removed with RemoveProperties in the MSBuild task call. This makes some sense for "regular" projects that build things (though see #9414), but there's another use of the MSBuild task: to ensure that some operation happens exactly once during a build no matter how big that build is--for instance "get some expensive value out of the git repo state" or "generate a version file for this build". But there's no way to specify "I promise that this project I am calling will only care about the explicit list of properties I pass it" so you're forced to add a bunch of stuff to RemoveProperties="TargetFramework;Configuration;Platform;..." which is inevitably incomplete.

@jeffkl
Copy link
Contributor

jeffkl commented Feb 4, 2025

I was originally thinking it should be RemoveProperties="*" but that seems unconventional so instead I agree that it should just be a boolean property, RemoveAllProperties="true".

@YuliiaKovalova YuliiaKovalova added triaged Priority:2 Work that is important, but not critical for the release labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Language Issues impacting the MSBuild programming language. Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

No branches or pull requests

3 participants