Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Created Unassigned: DataGrid: SharedThemeResourceDictionary does not load PresentationFramework.* from GAC because it doesn't provide full assembly information [22479]

$
0
0
If you specify a DataGridView theme such as Classic or Aero2, and you do not specifically add the matching PresentationFramework.*.dll assembly to the project with CopyLocal = true, the load will fail. The reason for this is in SharedThemeResourceDictionary.CreateUri it does not include the Version= or PublicKey= tags into the URI that's generated for the assembly loader.

This information is already passed to the CreateUri method, but it appears to be ignored completely.

Modifying the CreateUri method to include this information into the URI that's generated will fix this issue.

For example, before if I'm using ClassicTheme, the URI will look like this:

pack://application:,,,/PresentationFramework.Classic;;;component/themes/classic.xaml

and will fail to locate the assembly from the GAC because it's not given a full reference. The workaround for this is the rather cumbersome approach of including PresentationFramework.Classic.dll as a reference and using CopyLocal=true and distributing it with your application.

Changing the code to also include Version and PublicKeyToken so it looks like this:

pack://application:,,,/PresentationFramework.Classic,Version=4.0.0.0,PublicKeyToken=31bf3856ad364e35;;;component/themes/classic.xaml

This will locate and load the assembly from the GAC.

The commercial version of the DataGrid control doesn't appear have this issue so I assume this is something that was fixed in a later version as opposed to the older version of the control in the Extended WPF Toolkit. That said it would be great if this could be fixed in the free version as well for those of us that want to use the included themes without the extra headaches of packing framework assemblies.

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>