Description
The page is misleading. It states that the change only affects .NET 5, but in fact it also affect any version of .NET framework if the SDK for .NET 5 has been installed (regardless of whether any other SDKs are also installed).
I have a .NET 4.5.2 solution with a few WPF and Winforms projects including one that was explicitly set to <OutputType>Exe</OutputType>
to make sure the console was displayed. Upon updating Visual Studio (without any code or config change), it started to break (no console shown).
I would have expected the rule rewriting the OutputType
to be guarded and check that .NET 5 is part of the targeted frameworks. Or this page to be found in a more reachable section of the documentation: it took me a while to find it because I wasn't expected a change in .NET 5 to affect .NET Framework.
Steps to reproduce
Create a new winforms app. Change the target framework to net452
. Set the output type to Exe
explicitly --> no console.
Related issue: dotnet/sdk#13331
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: d8aa9669-0b6a-0429-23da-ebd62c5e6b34
- Version Independent ID: 5471792d-993c-61ce-b472-1e11b00b7adc
- Content: Breaking change: OutputType set to WinExe for WPF and WinForms apps - .NET
- Content Source: docs/core/compatibility/windows-forms/5.0/automatically-infer-winexe-output-type.md
- Product: dotnet-fundamentals
- GitHub Login: @gewarren
- Microsoft Alias: gewarren