Disable NETFX WinFX targets only when the SDK is used directly #4630
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially Fixes #4515
Partially Fixes dotnet/sdk#18062
Description
Disable .NET Framework's WinFX targets import only when the Windows Desktop SDK is used directly instead!
Example:
Here, we're simply moving the logic to the
Sdk.props
. This still does not fix the root of the problemwhere the SDK provided WinFX targets should work properly when targeting .NET Framework only projects.
Customer Impact
As per the issues mentioned above, the .NET Framework projects that depends on older inbox WinFX targets no longer used those targets and so, the build fails.
Regression
Yes, it was a regression due to behavior of WinFX imports in both Common targets and the Desktop SDK that revealed itself through #2976.
Testing
Works when tested locally.
Risk
Low, since the .NET 6 is still in preview.
It only fixes when the SDK used is .NET SDK instead of Windows Desktop SDK. Since .NET SDK in post 5.0 imports
WindowsDesktop.props
and so, we simply move the logic toSdk.props
. So, for those who depends on this behaviorshould use Windows Desktop SDK instead of the Main SDK, as shown above.