Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

light up container publish for all Exe/WinExe projects by default #47064

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

baronfel
Copy link
Member

@baronfel baronfel commented Feb 24, 2025

#47047 highlighted the issue that we've had for a long time in Containers that Console apps have to do a gesture to get containerization support. It's a very common user stumbling point. Let's see what happens if we light it up for those project types.

Regarding why we didn't do this earlier, I think I remember what the reason was: back when we were doing these defaults, the primary way to publish a container was via a Publish Profile - which required the project to import a set of logic and Tasks called the 'Publish SDK'. Web and Worker SDK projects do this already, so they lit up container support easily. However, Console projects couldn't import the Publish SDK easily because of MSBuild ordering/layering constraints.

Now that we've mostly moved off of PublishProfile-based support and onto 'normal' MSBuild Target invocation (-t:PublishContainer), it should be safer to toggle EnableSdkContainerSupport based on the OutputType of the project.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Feb 24, 2025
@baronfel
Copy link
Member Author

Test failures seem to be an issue with dotnet test that I believe has been fixed on the main branch. Updated the branch - let's see what we get.

@MattKotsenas
Copy link
Member

Drive-by review: when first adopting the publish container workflow, I believe a couple of apps forgot to enable this flag and instead (if I recall correctly) got the older Dockerfile-based tooling (i.e. https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/docker/visual-studio-tools-for-docker?view=aspnetcore-9.0) where you can F5 debug inside the container.

I bring it up just as a reminder of that older tooling and to make sure this change doesn't make things ambiguous.

Happy to do more research if needed; sorry this is somewhat vague.

@baronfel
Copy link
Member Author

Good call-out - I believe at this time both VS and VS Code support f5 debugging for the SDK tech, and that is predicated on checking for both this flag and the 'ProjectCapability' that we add to the project as ambient information.

cc @danegsta for heads-up

@danegsta
Copy link
Member

Good call-out - I believe at this time both VS and VS Code support f5 debugging for the SDK tech, and that is predicated on checking for both this flag and the 'ProjectCapability' that we add to the project as ambient information.

cc @danegsta for heads-up

Thanks for the heads up! I’ll bring this up in our team’s standup today so we can double check our detection logic (and the logic we use to special case publish for console, etc.). Would this change potentially get back ported to servicing releases for earlier SDKs?

@baronfel
Copy link
Member Author

Would this change potentially get back ported to servicing releases for earlier SDKs?

Depending on the speed of review we might be able to get it into 9.0.300, but maybe not further back.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area-Containers Related to dotnet SDK containers functionality untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants