title: Nancy - embedded views from other assembly
body: <p>I have created 2 projects:</p>
  
  <ol>
  <li><p>Class library with file Views\other.html set as embedded resource.</p></li>
  <li><p>Console app with Nancy self-hosting set up, bootstrapper and nancy module that simply responds to a GET by returning a view named "other.html" - the one defined in the other assembly.</p></li>
  </ol>
  
  <p>Bootstrapper config:</p>
  
  <pre><code>protected override void ConfigureApplicationContainer(TinyIoCContainer container)
  {  
      base.ConfigureApplicationContainer(container);
      ResourceViewLocationProvider.RootNamespaces.Add(GetType().Assembly, "ConsoleApplication1.Views"); // (1)
      ResourceViewLocationProvider.RootNamespaces.Add(typeof(Class1).Assembly, "ClassLibrary1.Views");
  }
  
  protected override NancyInternalConfiguration InternalConfiguration
  {
      get { return NancyInternalConfiguration.WithOverrides(OnConfigurationBuilder); }
  }
  
  private void OnConfigurationBuilder(NancyInternalConfiguration x)
  {
      x.ViewLocationProvider = typeof(ResourceViewLocationProvider);
  }
  </code></pre>
  
  <p>Application starts properly with this configuration but it fails to return the "other.html" which is defined as embedded resource of the other library.</p>
  
  <p>It works ok when I return a view that is embedded in the main console app.</p>
  
  <p>When I remove the line marked as (1) then app fails to start with the following error:</p>
  
  <pre><code>Unable to resolve type: Nancy.ViewEngines.ViewEngineApplicationStartup
  Only one view was found in assembly ConsoleApplication1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, but no rootnamespace had been registered.
  </code></pre>
  
  <p>What am I missing here?</p>