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.

Consider making FrameworkReferences implicit in WPF and Web SDKs

See original GitHub issue

In .NET Core 3.0, a WPF project will import the WPF SDK in its project element (<Project Sdk="Microsoft.NET.Sdk.Wpf">​), and will also have a FrameworkReference to Microsoft.DesktopUI (<FrameworkReference Include="Microsoft.DesktopUI"/>​). Similarly, ASP.NET Core projects will use the Microsoft.NET.Sdk.Web SDK, and will have a FrameworkReference to Microsoft.AspNetCore.

Having to specify both the Sdk and the FrameworkReference seems redundant. They do serve separate purposes: the FrameworkReference allows you to use the APIs in the shared framework, while the Sdk import brings in the build logic (for example, razor or xaml compilation, or default globs for the project type).

We should consider having WPF and Web SDKs by default include an implicit FrameworkReference to the corresponding shared framework, and removing the FrameworkReferences from the project templates.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
dsplaistedcommented, Oct 5, 2018

One advantage of an implicit FrameworkReference is that it could make it easier to multi-target a WPF project. It would be an error to specify a FrameworkReference if targeting .NET Framework, so you’d have to add a condition on the FrameworkReference item. However, if the FrameworkReference was implicit in the SDK, and the SDK also implicitly referenced a default set of WPF assemblies when targeting .NET Framework, then you could convert a .NET Core WPF project to multi-target to .NET Framework just by replacing <TargetFramework>netcoreapp3.0</TargetFramework> with <TargetFrameworks>netcoreapp3.0;net472</TargetFrameworks>

0reactions
dsplaistedcommented, Nov 16, 2018

This is now part of the latest build of the .NET Core SDK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add references in the Reference Manager - Visual Studio ...
You can explore the references in the Windows SDK or extension SDKs by ... Visual Basic projects contain an implicit reference to Microsoft....
Read more >
Build error: You must add a reference to System.Runtime
To implement the fix, first expand out the existing web.config ... C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.
Read more >
Implicit Using Statements In .NET 6 - NET Core Tutorials
I feel like a simpler idea would have been to edit the Visual Studio/Command Line templates that when you create a new web...
Read more >
Setting a Theme - Telerik UI for WPF - Documentation
Using implicit styles gives you full Blend support and smaller dlls size. To use this mechanism you will need to use the NoXaml...
Read more >
The Problem with C# 10 Implicit Usings
Yesterday I livestreamed myself upgrading a project to .NET 6 and C# 10. Along the way I tried using a new C# 10...
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