title: How can I fix compilation for relative paths using StackExchange.Precompilation?
body: <p>For <a href="https://github.com/StackExchange/StackExchange.Precompilation" rel="nofollow noreferrer">https://github.com/StackExchange/StackExchange.Precompilation</a>:</p>
  
  <p>We have some shared views in separate library where we have installed StackExchange.Precompilation. We have to load those views along with the normal web project's views. We have the latest version of StackExchange.Precompilation installed from NuGet in both projects. I am doing the assembly loading like this:</p>
  
  <pre><code>// Register precompiled view engine
  ViewEngines.Engines.Clear();
  
  List&lt;Assembly&gt; viewAssemblies = new List&lt;Assembly&gt; { typeof(HomeController).Assembly };
  viewAssemblies.AddRange(AppDomain.CurrentDomain.GetAssemblies().Where(a =&gt; a.FullName.ToLower().Contains(".web")));
  
  Log.Debug().Message("Looking for views in: {0}", string.Join(", ", viewAssemblies.Select(a =&gt; a.FullName))).Write();
  
  ViewEngines.Engines.Add(new PrecompiledViewEngine(viewAssemblies.ToArray()));
  </code></pre>
  
  <p>In the web project, we return views the normal way: <code>return View("Index");</code>
  When using <code>PrecompiledViewEngine</code> we get an error when trying to render relative names like that: </p>
  
  <pre><code>The view 'Index' or its master was not found or no view engine supports the searched locations. 
  The following locations were searched: 
  ~/util/Views/Example/Index.cshtml 
  ~/util/Views/Shared/Index.cshtml
  </code></pre>
  
  <p><code>util</code> is the alias of the application in IIS. We don't have <em>any</em> areas registered.</p>
  
  <p>When I copied the <code>PrecompiledViewEngine</code> class from GitHub - <strong>it worked</strong>! Am I missing something that will make the version distributed through NuGet work?</p>