-
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
PublishRelease=true in project file doesn't actually change the configuration to "Release" when running "dotnet publish" #26732
Comments
OK actually it might not be related to |
That is expected. It should work if you add it to If there is a concern that this should work in the |
I really think this needs to be supported in the project files, as all the other Publish prefixed MSBuild properties do today and not doing so for this (or the other new properties) makes this confusing. |
I agree with @DamianEdwards - what's the reason we need the props file? Is there some MSBuild limitation we're hitting up against? |
I agree it's confusing, I'll investigate this. Thanks for taking the time to test it. @baronfel I do believe that was why but there is probably a work around. |
You can already put |
I think the main reason this is different is we want it to only take place if we are |
Seems there's a property that's set by the CLI when Of course that's only true for invocations from the CLI, we'd need this to work for folks directly publishing from VS, or just invoking the publish target too. |
Adding @dsplaisted in case he has input. |
@DamianEdwards I added that and that's how The issue here is that the
|
I suppose the project author could avoid the Project/@SDK attribute and instead explicitly import Sdk.props and Sdk.targets as shown in How to: Use MSBuild project SDKs; then the csproj would be able to define PublishRelease before the imports. That doesn't seem any more convenient than Directory.Build.props, though. |
Thanks for pulling that up, it can work but I agree it's not optimal. Good news, though! @benvillalobos looked at this with me and it looks like even if |
Chiming in with a bit of context: We saw that the value of |
Is this going to be triaged for fixing in 7.0.100? |
That is correct, thank you for checking in and pushing for the right changes @DamianEdwards for our customers. I have been working on this amongst other issues due for 7.0.100. This needs to be completed by Aug 12 for that, correct? |
I cannot comment on the dates. Only @marcpopMSFT can. |
Aug 12 is the code-complete date for rc.1 so if we want it in rc.1 then I'd assume that's the date the change is needed in main by. |
From a standpoint of publishing a solution, this becomes more complicated. For example, if a solution contains a top-level project defining We decided to do the following: Check |
We got this working on
|
We decided to make it work for solutions via opt-in so the performance cost of checking this in a solution is not there by default. If a user tries to use |
@nagilson thanks for the updates. What release will the fix go into? rc.2? |
@DamianEdwards Indeed, I'm expecting it to go in rc.2. The PR has been thoroughly tested and reviewed, just waiting for the final thumbs-up at this point. But we are heavily backlogged with a number of p1 issues (part of the rc.1 delay -- sorry!) FYI The implicit RID and PublishSelfContained work is in a similar state, though needs some test updates and review. And of course, thanks for checking in. |
This was fixed last week in the release/7.0.1xx branch and should flow to the rc-2 branch when that's forked in the next week or two. Please let me know if any issues are encountered or you have any questions. #26808 Elsewise, please do close this issue. Thanks for trying it out! |
Thanks, I'll try this out once we have rc.2 builds. |
Confirmed this works as expected now in rc.2 builds, thanks! |
Awesome news, thanks for testing this 😄 |
RE #23551
Trying out
<PublishRelease>true</PublishRelease>
in a console project and it seems if I also set<PublishAot>true</PublishAot>
then a debug build is performed rather than a release build.HelloWorld.Console.csproj
Run
dotnet publish HelloWorld.Console -r win-x64 --self-contained -v -o .artifacts\HelloWorld.Console
Output:
dotnet --info
@nagilson @richlander
The text was updated successfully, but these errors were encountered: