title: StaticResource in app.xaml not found in Resource Dictionary referenced from app.xaml
body: <p>I've got a situation where I'm attempting to resolve visual components in a data template referenced in a resource dictionary, referring to a static resource of the <code>app.xaml</code> markup, see example below.</p>
  <p><code>App.xaml</code></p>
  <pre><code>&lt;Application 
      x:Class=&quot;App&quot; 
      xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot; 
      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;      
      xmlns:composition=&quot;clr-namespace:Composition&quot;
      ShutdownMode=&quot;OnMainWindowClose&quot;&gt;
      &lt;Application.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;composition:ApplicationContainer x:Key=&quot;ApplicationContainer&quot;/&gt;
              &lt;ResourceDictionary.MergedDictionaries&gt;
                  &lt;ResourceDictionary
  Source=&quot;pack://application:,,,/MyApp;component/Composition/DataTemplates.xaml&quot;/&gt;
              &lt;/ResourceDictionary.MergedDictionaries&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/Application.Resources&gt;
  &lt;/Application&gt;
  </code></pre>
  <p><code>Composition/DataTemplates.xaml</code></p>
  <pre><code>&lt;ResourceDictionary xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
                      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
                      xmlns:projectvm=&quot;clr-namespace:ViewModels.ProjectManagement&quot;
                      xmlns:unity=&quot;clr-namespace:Extensions&quot;&gt;
      &lt;DataTemplate DataType=&quot;{x:Type projectvm:ProjectDocument}&quot;&gt;
          &lt;ContentControl&gt;
              &lt;!-- Custom Extension that resolves a component from
              the composition container --&gt;
              &lt;unity:Resolve Container=&quot;{StaticResource ApplicationContainer}&quot;
    TargetType=&quot;{x:Type projectvm:ProjectDocument}&quot; ContractName=&quot;ProjectDocument&quot;/&gt;
          &lt;/ContentControl&gt;
      &lt;/DataTemplate&gt;
  &lt;/ResourceDictionary&gt; 
  </code></pre>
  <p>The error is just above. The unity: Resolve line cannot locate the <code>ApplicationContainer</code> Static Resource. And I don't understand why.</p>