tags:

views:

138

answers:

2

Hi there,

I have a silverlight application with a number of styles defined in a seperate xaml file under the directory /Styles. My App.xaml looks like this:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Styles/Legend.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

Legend.xaml has its build action set to Content and 'Do Not Copy' as the copy to output directory setting.

The message I'm getting in blend is:

An error occurred while finding the resource dictionary "/Styles/Legend.xaml"

Thanks in advance!

A: 

Don't ask me why but deleting the original resource dictionary and re-adding it solved the issue. Odd. Ah well

Sergio
+1  A: 

Also check that the xaml is properly formed! A stray character which invalidates the xaml syntax in that Legend.xaml file, will cause it not to recognise it. Instead of telling you it's malformed, it will give you the error you describe. Hope that helps someone.

Warren