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.

WPF Theme Assemblies are not usable under the current FrameworkReference design

See original GitHub issue

See discussion in https://github.com/dotnet/sdk/pull/3259 for context.

Background:

WPF’s theme assemblies (PresentationFramework.Aero, PresentationFramework.Aero2, PresentationFramework.AeroLite, PresentationFramework.Classic, PresentationFramework.Luna and PresentationFramework.Royale) expose the same types.

For e.g., DataGridHeaderBorder.

These assemblies can be used in two ways.

Typically, they are used as resource assemblies. i.e., they are not referenced from the project, and instead, XAML resources within them are consumed as resources using <ResourceDictionary ..>. When used this way, all of these assemblies can (and often are) used in to supply themes contextually (i.e., depending on the system theme, for e.g., or some other user preference).

Less commonly, they are directly referenced and their types are either consumed in XAML or directly in code. When used this way, only one assembly can be referenced directly. If more than one assembly needs to be referenced, namespace aliasing has to be used.

Problem:

The current SDK/FrameworkReference design in .NET Core always enables references to each of these assemblies. This makes them virtually unusable. We need a better scheme/solution.

/cc @nguerrera, @rladuca, @dsplaisted cc @dotnet/wpf-developers

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

4reactions
nguerreracommented, Jun 4, 2019

My preference is Reference items. It is more general, and it also unblocks other requests. We can have the capability to resolve individual references inside framework targeting packs, and designate some assemblies as not being in any “profile” and forced to resolve this way. I would further allow a way to specify a FrameworkReference with default compilation references excluded and allow individual references to be chosen. WPF itself is (or was at least) using custom trickery to implement a NetCoreReference, which could be made first class. Corefx also ran into similar problems. I

Ideally, it would be RAR that resolved these so that it respected the search paths, etc. Conceptually, we could add the framework targeting pack ref folders as target framework directories. For perf, we probably also want to pass in the framework lists to RAR. This may require some changes to the framework lists we have or changes to RAR.

We need to think about transitivity. By downgrading to Reference, there will be no transitivity through P2P, but nuget would likely recognize it as a frameworAssembly. I am not sure if that is good or bad. In the case of the particular anti-pattern of having multiple framework assemblies with the same fully qualified name, transitivity is kind of devastating, because you start using more than one because a dependency does.

2reactions
vatsan-madhavancommented, May 25, 2019

Also, here is a skeleton of a proposal from the original thread: link

The default - not reference any of them.

Put each of them in a separate newly added FrameworkReferences (Microsoft.WindowsDesktop.App.WPF.Aero, Microsoft.WindowsDesktop.App.WPF.Aero2, Microsoft.WindowsDesktop.App.WPF.Luna etc.) and allow them to be included them one at a time (UseWpfAero, UseWpfAero2 etc.).

And also provide a mechanism for enabling Aliases to each to support the scenario of more than one of them being requested simultaneously. I’m not sure what this would look like…

Read more comments on GitHub >

github_iconTop Results From Across the Web

The name does not exist in the namespace error in XAML
When you are writing your wpf code and VS tell that "The name ABCDE does not exist in the namespace clr-namespace:ABC".
Read more >
Troubleshoot broken references - Visual Studio
If projects are shared on different computers, some references might not be found when a component is located in a different directory.
Read more >
MSBuild reference for .NET SDK projects
This page is a work in progress and does not list all of the useful MSBuild properties for the .NET SDK. For a...
Read more >
Custom theme not rendered in design time / missing smart ...
I found the problem, our custom theme is working again in design time. The reason were missing references in our solution to DevExpress ......
Read more >
Using .NET Standard with Full Framework .NET - Rick Strahl
NET Standard forwarding assemblies that map the .NET Standard APIs to the actual underlying APIs on the specific Runtime.
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