You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was defining some intended UX at #26028 (comment). I realized that I didn't understand the precedence relationship in MSBuild and the CLI. If this is documented, it would have great to have the link. If not, we should document the behavior.
There are a few scenarios I have in mind. I'm sure that there are other ways to mix these things up. These are the ones that came to mind for me.
As far as I know, the CLI always wins. In both of the above scenarios, this is the case. I'm sure there might be cases where it doesn't work but that'd have to be related properties rather than matching properties. I don't believe PublishSelfContained has been implemented yet so I don't know how to answer your questions of competing project properties yet but for competing project properties, I don't think it's entirely predictable.
When we implement PublishSelfContained, it would be good to document the expected behavior somewhere and to ensure we either don't implement features with unpredictable behavior or document the narrow cases where they are unpredictable.
This is a common pit of failure for users, especially at solution-level builds. CLI-specified properties override project-local properties for the entire build, which often means that CLI properties are not the correct vehicle for any kind of logic that can vary.
@jaredpar has asked for something like --local-property in the past, which would ideally behave as a normal MSBuild Property with an initial value, but would otherwise participate in build logic and be overridable.
@jaredpar has asked for something like --local-property in the past, which would ideally behave as a normal MSBuild Property with an initial value, but would otherwise participate in build logic and be overridable.
Indeed. Essentially anything that let me set the initial property of a value for a build. This would just set a default initial value but have no other effect. The resulting property could be mutated just like any other property in subsequent build steps. I find the fact that -p prorties are global and immutable is generally confusing to customers.
I was defining some intended UX at #26028 (comment). I realized that I didn't understand the precedence relationship in MSBuild and the CLI. If this is documented, it would have great to have the link. If not, we should document the behavior.
There are a few scenarios I have in mind. I'm sure that there are other ways to mix these things up. These are the ones that came to mind for me.
Overlapping properties
Flip the properties in various ways.
and
Overlapping properties, between XML and the "MSBuild" CLI
and
Overlapping properties, between XML and the CLI
and
dotnet publish --self-contained true
The text was updated successfully, but these errors were encountered: