Skip to content
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

Automatically infer WinExe output type for WPF and Winforms applications #20373

Closed
marcpopMSFT opened this issue Aug 31, 2020 · 3 comments · Fixed by #20547
Closed

Automatically infer WinExe output type for WPF and Winforms applications #20373

marcpopMSFT opened this issue Aug 31, 2020 · 3 comments · Fixed by #20547
Assignees
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 5 Work items for the .NET 5 release

Comments

@marcpopMSFT
Copy link
Member

marcpopMSFT commented Aug 31, 2020

Automatically infer WinExe output type for WPF and Winforms applications

We are now automatically setting the OutputType to WinExe if the application is WPF or WindowsForms. This will suppress any console windows that would start up if the OutputType was set to exe. dotnet/sdk#12448

Version introduced

.NET 5 Preview 8

Old behavior

We would use the value set in the project.

New behavior

Default the OutputType value to WinExe

Reason for change

We assume most users do not want a console window coming up during execution of a WPF or WindowsForms and with these application types using the .NET sdk instead of the WindowsDesktop SDK, we wanted to ensure the right default was set. Further, when add support for targeting iOS and Android in .NET Core, it will make it easier to multi-target between multiple platforms if they all use the same output type.

Recommended action

Set <DisableWinExeOutputInference>true</DisableWinExeOutputInference> in your project file to revert to the old behavior.


Issue metadata

  • Issue type: breaking-change
@dotnet-bot dotnet-bot added ⌚ Not Triaged Not triaged breaking-change Indicates a .NET Core breaking change labels Aug 31, 2020
@gewarren gewarren added doc-idea 🏁 Release: .NET 5 Work items for the .NET 5 release and removed ⌚ Not Triaged Not triaged labels Sep 1, 2020
@gewarren gewarren self-assigned this Sep 1, 2020
@dsplaisted
Copy link
Member

@marcpopMSFT I've updated the description with my suggestions, most importantly by fixing a typo from not to now.

@Unknown6656
Copy link

Ahhh .... this explains the bug I am having.
(and which an other user has too: https://developercommunity.visualstudio.com/content/problem/1176945/console-app-broken-when-using-usewindowsforms-in-n.html)

@gewarren
Copy link
Contributor

@marcpopMSFT Was this change intended to apply to projects that target .NET Framework as well? See #21952.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 5 Work items for the .NET 5 release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants