I've been using MahApps.Metro from NuGet for a while without any issues. However, recently I had a few issues with NuGet packages needing to be reinstalled.
In the end, I uninstalled all of the NuGet packages I needed and reinstalled them. As far as I can tell, everything works correctly now except that when I try to start the application, it immediately throws the above exception:
System.Windows.Markup.XamlParseException: ''Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '34' and line position '18'.'
Inner Exception
IOException: Cannot locate resource 'styles/colors.xaml'.
And if I check those specified lines, it is this <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
.
My App.xaml looks like this:
<Application.Resources>
<ResourceDictionary>
<!-- Some other stuff is here -->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<!-- Bunch of other stuff here -->
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
I have tried various things from other similar questions:
- Changing "Colors" to "Colours"
- Changing "Colors" to "colors"
- Changing "Colors to "colours"
- Restore NuGet packages
- Uninstalled/reinstalled package
- Tried x86, x64 and AnyCPU target platforms
- Endless number of clean/rebuild solution with closing VS2017 inbetween
- Checked
StartupUri
is correct - Ensured
Assembly name
andDefault namespace
are different (and have always been)
I'm completely at a loss as to what try next...