Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Make multi-targeting constants local properties #2854
What I'm asking here is to add a
Let me elaborate. We have an old non-SDK style solution that we are gradually refactoring into AspNetCore and SDK-style. We were confronted with the build on the CI server failing miserably, because the target framework constants weren't defined during the build (e.g.
Adding to the confusion was the fact that if you add a custom
Ideally, it would behave the same way (concatenate the existing value) when it gets passed in via the command line arg.
Passing global parameters on the command line (or just having conflicting environment variables by accident - such as
Three behaviors of global properties seem to surprise people:
Now we could start a list with all the properties that you may want to pass via command line and try to find the best way to deal with each of them.
My personal suggestion is to use custom properties wherever possible, like
<DefineConstants Condition="'$(AdditionalDefineConstants)' != ''">$(DefineConstants );$(AdditionalDefineConstants)</DefineConstants>
or adding a logical switch to the project (
But I also believe that some areas like
I don't think the "inverse expectation makes" sense in the context of a multi-target build, though.
Multi-target builds branch out / build the same project with in a slightly different way. I'd expect this to be stable, regardless of what gets passed in the command line.
The inverse case would only work if the build author would specify an explicit
It's a very tricky situation.
Hmn, yes, it's a bit tricky since