title: `The component does not have a resource identified by the URI` when assembly is in different folder
body: <p>I am building a modular WPF app using Prism + Unity libraries. I split my solutions to following projects:
   - common project (interfaces)
   - main app, which loads dll
   - modules, they are NOT referenced by main app projects.</p>
  
  <p>Submodules dlls are built to bin\(Debug|Release)\Modules folder</p>
  
  <p>The code in main app to load is following:</p>
  
  <p>It:</p>
  
  <ol>
  <li>loads dlls from Modules folder</li>
  <li>register types in DI container</li>
  <li><p>setup modules from loaded dll (search for IModule types)</p>
  
  <pre><code>protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
  {
      base.ConfigureModuleCatalog(moduleCatalog);
  
      List&lt;Assembly&gt; allAssemblies = new List&lt;Assembly&gt;();
      string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
  
      foreach (string dll in Directory.GetFiles(path + "/Modules/", "*.dll"))
          allAssemblies.Add(Assembly.LoadFile(dll));
  
      AutoRegisterClasses(allAssemblies);
  
      var modules = AllClasses.FromAssemblies(allAssemblies).Where(t =&gt; t.GetInterfaces().Contains(typeof(IModule)));
  
      foreach (var module in modules)
      {
          moduleCatalog.AddModule(
              new ModuleInfo()
              {
                  ModuleName = module.Name,
                  ModuleType = module.AssemblyQualifiedName,
                  Ref = "file://" + module.Assembly.Location
              });
      }
  }
  
  private void AutoRegisterClasses(List&lt;Assembly&gt; allAssemblies)
  {
      var defaultRegisters = AllClasses.FromAssemblies(allAssemblies).Where(t =&gt; t.IsDefined(typeof(AutoRegisterAttribute), true));
  
      foreach (var register in defaultRegisters)         
          foreach (var interface_ in register.GetInterfaces()) 
              Container.GetContainer().RegisterType(interface_, register, null, new TransientLifetimeManager());
  }
  </code></pre></li>
  </ol>
  
  <p>Registration and module initialization works - everything is called. When I try to resolve <strong>an interace from common project</strong> which <strong>is implemented in submodule project</strong> I receive correct object. But when I try to display <strong>ContentControl</strong> which is returned by this provider I receive following exception:</p>
  
  <blockquote>
    <p>The component 'AdditionalDll.MainWindow' does not have a resource identified by the URI '/AdditionalDll;component/mainwindow.xaml'.</p>
  </blockquote>
  
  <p>I have no idea why is it a problem, what is more interesting, when I do not store DLLs in Modules folder - that is, when I store them side by side with main exe, <strong>everything works</strong>!!!</p>
  
  <p>I have created minimal solution which has this problem:
  <a href="https://github.com/BAndysc/AssemblyLoadProblemExample" rel="nofollow noreferrer">https://github.com/BAndysc/AssemblyLoadProblemExample</a></p>
  
  <pre><code>Common/Interfaces.cs - is common project, contains AutoRegister attribute and example interface that I will try to resolve
  AdditionalDll/ExampleProvider.cs - is in submodule project, it is implementation of the mentioned interface, it returns new view from AdditionalDll project
  TestMultiProjectApp/App.xaml.cs - setups everything - load dlls, register types, init modules
  TestMultiProjectApp/MainWindow.xaml - is simple view, which shows given ContentControl
  TestMultiProjectApp/MainWindowViewModel.cs - is simple viewmodel, which resolves IProvider interface (it works) and on command assigns returned view to property, which is then displayed by view (this causes exception)
  </code></pre>
  
  <p>While keeping dlls in same folder as exe is some workaround, I would rather keep them in separate folder to keep things tidy, if anyone has an idea how to fix them, I will appreciate this.</p>