Skip to content

Conversation

@Nirmal4G
Copy link
Contributor

@Nirmal4G Nirmal4G commented Jun 4, 2021

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:

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop" />

Here, we're simply moving the logic to the Sdk.props. This still does not fix the root of the problem
where 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 to Sdk.props. So, for those who depends on this behavior
should use Windows Desktop SDK instead of the Main SDK, as shown above.

Only when the Windows Desktop SDK is used directly instead!

Example:

```xml
-<Project Sdk="Microsoft.NET.Sdk" />
+<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
```
@Nirmal4G Nirmal4G requested a review from a team as a code owner June 4, 2021 13:47
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Jun 4, 2021
@ghost ghost requested review from SamBent, fabiant3 and ryalanms June 4, 2021 13:47
@ryalanms
Copy link
Member

ryalanms commented Jun 4, 2021

Thanks, @Nirmal4G.

@ryalanms ryalanms merged commit d26eaac into dotnet:main Jun 4, 2021
@Nirmal4G Nirmal4G deleted the hotfix/disable-netfx-winfx branch June 4, 2021 16:31
@ghost ghost locked as resolved and limited conversation to collaborators Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev17 breaks ability to compile some WPF projects SDK-style WPF Projects targeting net472 are broken because ImportFrameworkWinFXTargets is false

3 participants