Add WindowsDesktop warnings and errors#12386
Conversation
|
agree with Daniel. The rest is good |
|
@dsplaisted @wli3 @rainersigwald do you have any more feedback here? |
|
|
||
| <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0))"> | ||
| <_EnableDefaultWindowsPlatform Condition="'$(_EnableDefaultWindowsPlatform)' == ''" >false</_EnableDefaultWindowsPlatform> | ||
| <_EnableDefaultWindowsPlatform Condition="'$(_EnableDefaultWindowsPlatform)' == '' and '$(UseWPF)' != 'true' and '$(UseWindowsForms)' != 'true'" >false</_EnableDefaultWindowsPlatform> |
There was a problem hiding this comment.
I think we should still set _EnableDefaultWindowsPlatform to false in all cases. We don't want the legacy MSBuild logic which sets it to Windows 7.0 to be active.
Then Windows Forms or WPF projects will get the WindowsDesktopTargetPlatformMustBeWindows error you're adding if they don't set the target platform to Windows.
We can temporarily set the TargetPlatformIdentifier to Windows here if UseWPF or UseWindowsForms is true, until we have the TargetFramework support for net5.0-windows and the Windows Forms / WPF templates are updated.
Does that make sense?
There was a problem hiding this comment.
Yes, that makes sense. I've made #12492 to track removing this change once the templates are updated.
e47009d to
8b7fe09
Compare
Fixes #11241
Depends on #12108 to complete testing (cc @wli3)