question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SDK-style WPF Projects targeting net472 are broken because ImportFrameworkWinFXTargets is false

See original GitHub issue

This 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
Nirmal4Gcommented, May 14, 2021

In .NET SDK’s BeforeCommon.targets These Lines 49-56 reset it to true when targeting .NETFramework but doesn’t do that! since, we set this in props in the Windows Desktop SDK. So, the solution here is, either remove the setting from the WindowsDesktop.props which may break projects or move the setting to Sdk.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.

2reactions
dsplaistedcommented, May 14, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found