When you add resource dictionary files aka style files, you may run into following errors.
{System.Windows.Markup.XamlParseException: Failed to assign to property
'System.Windows.ResourceDictionary.Source'. [Line: 8 Position: 32]
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at SilverLayout.App.InitializeComponent()
at SilverLayout.App..ctor()}
As the error indicates that there is something wrong related to Source property of ResourceDictionary object. Following example shows XAML snippet from my App.xaml file where I was trying to add a resource dictionary.
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Assets\LayoutStyles.xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<Application.Resources>
If you look at the code snippet there does not seem to be anything wrong with it. But I have marked part of it with RED. Yes, I accidently used BACK SLASH (\) in the path. Parser did not like that while resolving path to that dictionary file. To fix this problem I just has to switch to using FORWARD SLASH (/)
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Assets/LayoutStyles.xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<Application.Resources>
Fix Failed to assign to property error
How to fix fix error -The feature global using directive is currently in Preview
How to plan CCSP Exam preparation
Develop a MongoDB pipeline to transform data into time buckets
Alert and Confirm pop up using BootBox in AngularJS
AngularJS Grouped Bar Chart and Line Chart using D3
How to lock and unlock account in Asp.Net Identity provider
2024 © Byteblocks, ALL Rights Reserved. Privacy Policy | Terms of Use