I\'m in the process of building a WPF application and ran into an error when trying to reference a resource dictionary. Inside my WPF application project I have a folder cal
Sometimes closing Visual Studio and open it again solves this problem.
Change the target .net version to an older one in the project properties and then reset to the previous version.
Make sure that the build action for MetroTheme.xaml is set to Page.
I had the same issue, but setting Build Action = Page did not solve for me. Turned out I needed to use the Pack URI Format. So,
<ResourceDictionary Source="pack://application:,,,/Styles/MetroTheme.xaml"/>
EDIT
Turns out the above will eliminate build error but still results in runtime error. I needed to include full assembly specification for complete resolution (even though all files are in same assembly):
<ResourceDictionary Source="pack://application:,,,/WpfApplication10;component/Styles/MetroTheme.xaml"/>