Loading merged ResourceDictionary from different assembly fails

More details on Pack URIs in WPF & Merged Resource Dictionaries

Build action should be Resource.


The build action should be defined as Resource or Content if you are willing to do some of the leg work.

Your resource must be defined as part of the project as a Resource build action. If you include a resource .xaml file in the project as Resource, you do not need to copy the resource file to the output directory, the resource is already included within the compiled application. You can also use Content build action, but you must then copy the files to the output directory and also deploy the resource files in the same path relationship to the executable.


From my observation. Setting the resource dictonary build style to Resource can cause bizarre errors further down the road (I suddenly started getting runtime errors Cannot create X where X was a user defined type referenced in my resource dictionary).

I recommend leaving the build style at Page. From what I've seen this should work just fine.

Tags:

C#

.Net

Wpf

Xaml