Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2013: An error occurred while finding the resource dictionary

I just got VS2013 and opened my VS2010 project. However now I cannot see any of xaml designs. The problem is the Styles are not being applied:

   <UserControl.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Themes/Colors.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>

Gives me the error:

Error 1 An error occurred while finding the resource dictionary "/Themes/Colors.xaml".

This works fine in VS2010. The build option is set to Page. All target frameworks are set to .NET 4.

The directory structure is this:

Host\Themes\Colors.xaml    
Plugins\EqPlugin\Source\ProblemFile.xaml

The themes are defined in the VEParameters project and have this declared:

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:local="clr-namespace:EQPlugin;assembly=VEParameterTool">

The file where the error occurs is in the EqPlugIn directory and has this declared:

<UserControl x:Class="EQPlugin.EQControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:src="clr-namespace:VEParameterTool;assembly=VEParameterTool"             
             xmlns:l="clr-namespace:EQPlugin"  
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:oxy="http://oxyplot.codeplex.com"
             mc:Ignorable="d">

I have tried changing the paths to relative paths but that doesn't work, i have removed and re-added the assemblies, i have restarted etc, all projects are build for the same framework. I don't know what else to try.

like image 938
Andy Avatar asked Nov 05 '13 00:11

Andy


1 Answers

Try the below one, Provied the assembly name, even if it is in the same assembly

Source="pack://application:,,,/<assemblyName>;component/Themes/Colors.xaml" 
like image 61
Kumareshan Avatar answered Sep 21 '22 18:09

Kumareshan