When using PresentationFramework.Aero, do I need to set “Copy Local” to true (and include it in my setup project)?

I just found the following on MSDN:

You can also make a dynamic reference to an assembly by providing the
calling method with only partial information about the assembly, such
as specifying only the assembly name. In this case, only the
application directory is searched for the assembly, and no other
checking occurs.

That explains the behavior I was seeing and why the GAC was not searched for PresentationFramework.aero.dll. I changed the dynamic reference to a full reference and removed “Copy Local” from PresentationFramework.aero. It now works without needing PresentationFramework.aero.dll in my application directory.

For reference, here is the working resource dictionary code:

<ResourceDictionary Source="/PresentationFramework.Aero,Version=3.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL;component/themes/Aero.NormalColor.xaml" />

In short, delete the local copy of your themes(in case you have added in your solution), add the full reference in the App.xaml file under Application.Resources (Resource Dictionary) and this should do.

Leave a Comment