-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 WindowsDesktop warnings and errors #12386
Conversation
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.DefaultItems.targets
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.DefaultItems.targets
Outdated
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.DefaultItems.targets
Outdated
Show resolved
Hide resolved
src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs
Outdated
Show resolved
Hide resolved
src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs
Outdated
Show resolved
Hide resolved
...sts/Microsoft.NET.TestFramework/Attributes/WindowsOnlyRequiresMSBuildVersionFactAttribute.cs
Outdated
Show resolved
Hide resolved
agree with Daniel. The rest is good |
@dsplaisted @wli3 @rainersigwald do you have any more feedback here? |
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.DefaultItems.targets
Outdated
Show resolved
Hide resolved
@@ -157,7 +157,7 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
</Target> | |||
|
|||
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that makes sense. I've made #12492 to track removing this change once the templates are updated.
src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAWindowsDesktopProject.cs
Show resolved
Hide resolved
e47009d
to
8b7fe09
Compare
Fixes #11241
Depends on #12108 to complete testing (cc @wli3)