Skip to content

Commit

Permalink
Make the Framework WinFX targets import opt-out
Browse files Browse the repository at this point in the history
Currently there's no way to properly switch between NETFX's and CoreCLR's WinFX targets.
This adds an opt-out, just in case, if we want to use the NETFX's WinFX targets instead.
  • Loading branch information
Nirmal4G committed Aug 17, 2021
1 parent 7977151 commit 2b2c3ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packaging/Microsoft.NET.Sdk.WindowsDesktop/Sdk/Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ Copyright (c) .NET Foundation. All rights reserved.
Workaround: https://github.com/microsoft/msbuild/issues/4948
Disable .NET Framework's inbox WinFX targets when using the SDK, since, we really don't use it's build logic
and is superseded by 'WindowsDesktop' SDK that provides it's own WinFX for both NETFX and CoreCLR targets.
Make it opt-out, just in case, if something fails or we don't want to use 'WindowsDesktop' SDK's version.
-->
<PropertyGroup>
<ImportFrameworkWinFXTargets>false</ImportFrameworkWinFXTargets>
<ImportFrameworkWinFXTargets Condition="'$(ImportFrameworkWinFXTargets)' == ''">false</ImportFrameworkWinFXTargets>
</PropertyGroup>

<Import Project="$(MicrosoftWindowsDesktopSdkPath)\Microsoft.NET.Sdk.WindowsDesktop.props "/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
<SupportedTargetFramework Remove="@(_UnsupportedNETCoreAppTargetFramework);@(_UnsupportedNETStandardTargetFramework);@(_UnsupportedNETFrameworkTargetFramework)" />
</ItemGroup>

<!-- Import WPF Build tasks -->
<Import Project="Microsoft.WinFX.props" />
<!-- Import WPF Build tasks only when we don't import NETFX's WinFX targets -->
<Import Project="Microsoft.WinFX.props" Condition="'$(ImportFrameworkWinFXTargets)' != 'true'" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<NetSdkWarning ResourceName="WindowsDesktopFrameworkRequiresVersion30" />
</Target>

<!-- Import WPF Build logic -->
<Import Project="Microsoft.WinFX.targets" />
<!-- Import WPF Build logic only when we don't import NETFX's WinFX targets -->
<Import Project="Microsoft.WinFX.targets" Condition="'$(ImportFrameworkWinFXTargets)' != 'true'" />

</Project>

0 comments on commit 2b2c3ec

Please sign in to comment.