dotnet / dotnet/project-system
`UseWindowsForms` and `UseWPF` properties should be always available when targeting Windows
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
It's common for libraries and console applications to use miscellaneous APIs from Windows Forms or WPF. In legacy-style projects, you would use "Add Reference" to add `System.Windows.Forms` to your application or library. Today it's not possible to do the same with SDK-style projects without manually editing the project file. Though we do expose `UseWindowsForms` and `UseWPF` in the project properties, they are only visible when the output type is `WinExe` (i.e. not a console application or library).
However, as of .NET 5, we have a more appropriate key for these properties—the target OS. We should change these properties to be visible when `TargetPlatformIdentifier`==`Windows`, rather than when `OutputType`==`WinExe`.
Contributor guide
Assessment
This issue has not been assessed yet.