Skip to content

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

Closed
@marcpopMSFT

Description

@marcpopMSFT

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

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 5Work items for the .NET 5 releasebreaking-changeIndicates a .NET Core breaking change

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions