SDK-style WPF Projects targeting net472 are broken because ImportFrameworkWinFXTargets is false
See original GitHub issueThis PR has regressed building WPF projects that use the SDK-style: https://github.com/dotnet/wpf/pull/2976
By default ImportFrameworkWinFXTargets was true
, but now changes to false
, resulting in MarkupCompile not running.
FYI @Nirmal4G
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Build issues when referencing project that targets multiple ...
I'm working on converting a large WPF solution's projects to SDK style and ran into some issues. The solution is large with multiple...
Read more >Target frameworks in SDK-style projects - .NET
When you target a framework in an app or library, you're specifying the set of APIs that you'd like to make available to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In .NET SDK’s
BeforeCommon.targets
These Lines 49-56 reset it totrue
when targeting.NETFramework
but doesn’t do that! since, we set this inprops
in the Windows Desktop SDK. So, the solution here is, either remove the setting from theWindowsDesktop.props
which may break projects or move the setting toSdk.props
and update the Main SDK logic to handle this case.I recommend we move the setting to
Sdk.props
to preserve it’s intended behavior—as it was meant be used only when using the Windows Desktop SDK directly. My PR was supposed to be merged before the v5 refactoring but was delayed. Meanwhile, I didn’t know the logic was being updated in the Main SDK during that time.I can go ahead and open a PR on what the team recommends.
Yeah, it made sense to set this to false in WindowsDesktop.props when that was only imported if the project was explicitly using Microsoft.NET.Sdk.WindowsDesktop. But now we always import that props file.
You could move it to the WindowsDesktop Sdk.props file, I think that would work in both situations.