title: Unable to find MergedDictionaries in app.xaml
body: <p>I have created a WPF application (named "Ferhad.Wpf"). Then I added two class libraries with names "Ferhad.Wpf.Core" and "Ferhad.Wpf.SystemStyles" to the solution.</p>
  
  <p>There is only "Resources.xaml" in "Ferhad.Wpf.Core".</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
  
      &lt;SolidColorBrush x:Key="Foreground" Color="#FFFFFF" /&gt;
      &lt;SolidColorBrush x:Key="BackgroundNormal" Color="#3F3F46" /&gt;
      &lt;SolidColorBrush x:Key="BorderBrushNormal" Color="#54545C" /&gt;
      &lt;SolidColorBrush x:Key="BorderBrushHighlighted" Color="#6A6A75" /&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>But there are also "ButtonStyles.xaml" and "Styles.xaml" in "Ferhad.Wpf.SystemStyles".
  Here is "ButtonStyles.xaml":</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;ResourceDictionary.MergedDictionaries&gt;
          &lt;ResourceDictionary Source="pack://application:,,,/Ferhad.Wpf.Core;component/Resources.xaml" /&gt;
      &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;Style x:Key="StandartButton" TargetType="Button"&gt;
          &lt;Setter Property="Visibility" Value="Visible" /&gt;
          &lt;Setter Property="Foreground" Value="{StaticResource Foreground}" /&gt;
          &lt;Setter Property="Background" Value="{StaticResource BackgroundNormal}" /&gt;
          &lt;Setter Property="BorderBrush" Value="{StaticResource BorderBrushNormal}" /&gt;
      &lt;/Style&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>and "Styles.xaml":</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;ResourceDictionary.MergedDictionaries&gt;
          &lt;ResourceDictionary Source="ButtonStyles.xaml" /&gt;
      &lt;/ResourceDictionary.MergedDictionaries&gt;
  
      &lt;Style TargetType="Button" BasedOn="{StaticResource StandartButton}" /&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>And here is app.xaml:</p>
  
  <pre><code>&lt;Application x:Class="Ferhad.Wpf.App"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               StartupUri="MainWindow.xaml"&gt;
      &lt;Application.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;ResourceDictionary.MergedDictionaries&gt;
                  &lt;ResourceDictionary Source="pack://application:,,,/Ferhad.Wpf.SystemStyles;component/Styles.xaml" /&gt;
              &lt;/ResourceDictionary.MergedDictionaries&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/Application.Resources&gt;
  &lt;/Application&gt;
  </code></pre>
  
  <p>Everything seems fine at design time of MainWindow.xaml, but when running the application an exception is thrown: <code>Set property 'System.Windows.ResourceDictionary.Source' threw an exception.</code></p>
  
  <p>I have googled about it, but nothing has helped. I have tried to change the BuildAction of files, but that did not help either.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>The exception is on line number '8' and line position '18'.</p>
  
  <p>And the inner exception is: <code>{"Could not load file or assembly 'Ferhad.Wpf.SystemStyles, Culture=neutral' or one of its dependencies. The system cannot find the file specified.":"Ferhad.Wpf.SystemStyles, Culture=neutral"}</code></p>