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

Add warnings for WindowsDesktop targeting #11241

Closed
dsplaisted opened this issue Apr 10, 2020 · 0 comments · Fixed by #12386
Closed

Add warnings for WindowsDesktop targeting #11241

dsplaisted opened this issue Apr 10, 2020 · 0 comments · Fixed by #12386
Assignees
Milestone

Comments

@dsplaisted
Copy link
Member

In .NET 5.0, you will need to specify the TargetPlatform of Windows in order to use Windows Forms or WPF. You also won't need to use Microsoft.NET.Sdk.WindowsDesktop, you can just use Microsoft.NET.Sdk. We should add appropriate warnings in the following situations:

  • If the WindowsDesktop SDK is used, we may want to let you know that you can use Microsoft.NET.Sdk instead.
  • If UseWindowsForms or UseWPF is true and the TargetFramework is net5.0 or higher (with no -windows), warn or error that the TargetFramework should be net5.0-windows to use Windows Forms or WPF
  • If the TargetFramework is net5.0 or higher (with no -windows), and a transitive dependency brings in one of the Microsoft.NETCore.App.WindowsDesktop shared frameworks, we should do one or more of the following:
    • Warn or error that -windows should be added to the TargetFramework
    • Make things work: make sure the right framework is referenced in the runtimeconfig, and adjust the TargetPlatformIdentifier if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants