title: Publishing ASP.NET MVC/AngularJS Application
body: <p>I'm working on an ASP.NET MVC application with an AngularJS front-end and it's working great when running from visual studio/iis express, but not so great when I try to publish it so it's accessible to other users (e.g. navigating to <a href="http://server/application" rel="nofollow">http://server/application</a> in a browser). I have IIS configured on server so that <a href="http://server/application" rel="nofollow">http://server/application</a> points to an "application" folder that is structured as:</p>
  
  <pre><code>application
      app
          areas
          foundation
          main
              layout
                  layout.html
      bin
      Content
      fonts
      Scripts
      Templates
      Views
          Shared
              _Layout.cshtml
              Index.cshtml
      Logs
      Global.asax
      web.config
  </code></pre>
  
  <p>The initial page, Index.cshtml (under Views/Shared/), gets loaded but includes this:</p>
  
  <pre><code>&lt;div ng-include="'app/main/layout/layout.html'"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>which returns a 500.24 - Internal Server Error.</p>
  
  <p>If I change the ng-include to:</p>
  
  <pre><code>&lt;div ng-include="'application/app/main/layout/layout.html'"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>then the published application works but running it from visual studio/iis express returns a 404.0 - Not Found response when trying to load that layout.html file, I'm assuming because there's no parent "application" folder when it's running using iisexpress.</p>
  
  <p>I did manage to get the published application working at one point by copying the contents of the published application folder to server's C:\inetpub\wwwroot folder but that doesn't seem like a proper solution, so what's the best way to inform Angular to look in the correct location for this ng-include?</p>