-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dotnet build /t:Publish -p:_IsPublishing=true
should use Release config
#46276
Comments
We could, though it feels redundant to have to type IsPublishing twice and technically it's supposed to be a hidden property; having this pattern propagated around wouldn't be ideal. Also, PublishRelease is gated on the TargetFramework which the logic for happens after Configuration, so we can't respect the value of PublishRelease with this approach if it was false (say, CI machine decided to opt out to the breaking change) -- by the time we knew publish release was false, configuration would be set to release already when doing a basic dotnet publish in this case. We would have to do another breaking change to support this which we could but I dont think this issue is about that. I think this is a smart consideration but sadly it doesn't really work this way and I dont think we want to support a scenario like this half the way. Maybe @rainersigwald would have more to say. |
I find that very convincing @nagilson. |
I agree - this proposal is aimed at fixing the behavior of
You're pointing out that setting |
Folks who invoke the publish target directly will get different behavior from
dotnet publish
.dotnet publish
does a release build by default:dotnet build /t:Publish
does a debug build:Passing
-p:_IsPublishing=true
doesn't change this:Should we add logic early in the SDK that sets Configuration to Release (maybe depending on the value of PublishRelease), when _IsPublishing is true? This would help ensure that the default publishing output paths are different from the default build output paths: #26324 (comment).
@rainersigwald @nagilson @marcpopMSFT @dsplaisted @agocke
The text was updated successfully, but these errors were encountered: