dotnet / dotnet/msbuild

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

Open
#11,390 1 comment 3 reactions 0 assignees View on GitHub
Area: Language Priority:2 triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

(inciting incident is https://github.com/microsoft/MSBuildSdks/pull/601#discussion_r1941818975 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.