I have created WPF application in Visual Studio 2010 when I run the application in Visual Studio 2017 it is generating the following Unhandled Exception:
System.Windows.Markup.XamlParseException: 'Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '8' and line position '18'. ---> System.IO.IOException: Cannot locate resource 'resourcedic/maindictionary.xaml'.
Following is the app.xaml file that I am using in the application:-
<Application x:Class="AttendenceSystem.UI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="StartWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ResourceDic\MainDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
How can I resolve this error?
I had the same issue, I had to add this itemGroup to the .csproj of the project
<ItemGroup>
<PackageReference Include="MaterialDesignThemes.Wpf">
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>12.0.3</Version>
</PackageReference>
</ItemGroup>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With