title: Nested dart project prevents ServiceStack.Razor views from rendering
body: <p><strong>The situation</strong></p>
  
  <p>I'm developing a pure ServiceStack/Razor application (no MVC4 or Web API) using licensed ServiceStack 4.0.12.  I have a view (cshtml) that references a Javascript file which is transpiled from a dart project (using AngularDart).  </p>
  
  <p>For convenience, I nest the dart project folder within the ServiceStack project, but do not include it in Visual Studio. I then work on my dart project using Dart Editor separately.</p>
  
  <p>The overall project structure looks something like this:</p>
  
  <pre><code>MyApp.csproj
  Global.asax.cs
  \Controllers           &lt;- contains the IService formatted by 'Views\index.cshtml'.
  \Dart                  &lt;- not included in Visual Studio project.
       \packages
       \build
             \myapp.dart.js
       \lib
       \web
           \myapp.dart
  \Views                 
        \index.cshtml    &lt;- references 'myapp.dart.js'
  </code></pre>
  
  <p>I set up a simple, working ServiceStack/Razor 'Hello World' in Local IIS, then switched to Dart Editor to set up my dart project.</p>
  
  <p><strong>The problem</strong></p>
  
  <p>Imagine my frustration switch back a few minutes later only to find that my beautiful 'Hello World' has been replaced by 'Snapshot of Index'.  Without having touched a single line of code, config or re-compiled.</p>
  
  <p>When I switched to IIS Express, the ServiceStack/Razor app would work fine again. Same code, no changes to config or re-compilation.</p>
  
  <p>After losing hair for several hours, poking various config settings and playing with a sandbox project to no effect, I happened to move the 'Dart' folder OUT of the VS project folder, modified Web.config and refreshed the app - and the app worked again!</p>
  
  <p>Sure enough, when I put the 'Dart' folder back into the project folder, modified Web.config and refreshed - the app reverted to Snapshot again.</p>
  
  <p><strong>The question</strong></p>
  
  <p>Of course, my question is can anyone tell me why nesting the Dart project folder within the ServiceStack project folder causes ServiceStack.Razor to stop rendering views?</p>
  
  <p><strong>Edit: More info</strong></p>
  
  <p>The Dart folder contains the following file types:</p>
  
  <ul>
  <li>pubspec.yaml</li>
  <li>pubspec.lock</li>
  <li>*.js</li>
  <li>*.dart</li>
  <li>*.json</li>
  <li>a shortcut to the 'packages' folder from the 'web' folder (DartEditor creates this)</li>
  </ul>
  
  <p><strong>Edit: More info from Mythz's advice</strong></p>
  
  <p><pre>?debug=requestinfo</pre> yielded the following StartUpErrors:</p>
  
  <pre><code>"StartUpErrors": [
          {
              "ErrorCode": "UnauthorizedAccessException",
              "Message": "Access to the path 'D:\\Semi Da Vinci\\git\\BEAU\\BEAU.Beaufort.git\\Source\\BEAU.Beaufort.Website\\Dart\\packages\\analyzer' is denied.",
              "StackTrace": "[Object: 12/03/2014 4:44:51 PM]:\n[REQUEST: ]\nSystem.UnauthorizedAccessException: Access to the path 'D:\\Semi Da Vinci\\git\\BEAU\\BEAU.Beaufort.git\\Source\\BEAU.Beaufort.Website\\Dart\\packages\\analyzer' is denied.\r\n   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n   at System.IO.FileSystemEnumerableIterator`1.CommonInit()\r\n   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)\r\n   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)\r\n   at ServiceStack.VirtualPath.FileSystemVirtualDirectory.GetMatchingFilesInDir(String globPattern)\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at System.Linq.Enumerable.&lt;SelectManyIterator&gt;d__14`2.MoveNext()\r\n   at System.Linq.Enumerable.&lt;DistinctIterator&gt;d__81`1.MoveNext()\r\n   at ServiceStack.Formats.MarkdownFormat.&lt;FindMarkdownPages&gt;d__7.MoveNext()\r\n   at ServiceStack.Formats.MarkdownFormat.RegisterMarkdownPages(String dirPath)\r\n   at ServiceStack.Formats.MarkdownFormat.Register(IAppHost appHost)\r\n   at ServiceStack.ServiceStackHost.LoadPlugin(IPlugin[] plugins)",
              "Errors": []
          },
          {
              "ErrorCode": "UnauthorizedAccessException",
              "Message": "Access to the path 'D:\\Semi Da Vinci\\git\\BEAU\\BEAU.Beaufort.git\\Source\\BEAU.Beaufort.Website\\Dart\\packages\\analyzer' is denied.",
              "StackTrace": "[Object: 12/03/2014 4:44:51 PM]:\n[REQUEST: ]\nSystem.UnauthorizedAccessException: Access to the path 'D:\\Semi Da Vinci\\git\\BEAU\\BEAU.Beaufort.git\\Source\\BEAU.Beaufort.Website\\Dart\\packages\\analyzer' is denied.\r\n   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n   at System.IO.FileSystemEnumerableIterator`1.CommonInit()\r\n   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)\r\n   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)\r\n   at ServiceStack.VirtualPath.FileSystemVirtualDirectory.GetMatchingFilesInDir(String globPattern)\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at System.Linq.Enumerable.&lt;SelectManyIterator&gt;d__14`2.MoveNext()\r\n   at System.Linq.Enumerable.&lt;DistinctIterator&gt;d__81`1.MoveNext()\r\n   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()\r\n   at ServiceStack.EnumerableExtensions.Each[T](IEnumerable`1 values, Action`1 action)\r\n   at ServiceStack.Razor.Managers.RazorViewManager.Init()\r\n   at ServiceStack.Razor.RazorFormat.Init()\r\n   at ServiceStack.Razor.RazorFormat.Register(IAppHost appHost)",
              "Errors": []
          },
          {
              "ErrorCode": "UnauthorizedAccessException",
              "Message": "Access to the path 'D:\\Semi Da Vinci\\git\\BEAU\\BEAU.Beaufort.git\\Source\\BEAU.Beaufort.Website\\Dart\\packages\\analyzer' is denied.",
              "StackTrace": "[Object: 12/03/2014 4:44:51 PM]:\n[REQUEST: ]\nSystem.UnauthorizedAccessException: Access to the path 'D:\\Semi Da Vinci\\git\\BEAU\\BEAU.Beaufort.git\\Source\\BEAU.Beaufort.Website\\Dart\\packages\\analyzer' is denied.\r\n   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n   at System.IO.FileSystemEnumerableIterator`1.CommonInit()\r\n   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)\r\n   at System.IO.DirectoryInfo.InternalGetFiles(String searchPattern, SearchOption searchOption)\r\n   at ServiceStack.VirtualPath.FileSystemVirtualDirectory.GetMatchingFilesInDir(String globPattern)\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at ServiceStack.VirtualPath.AbstractVirtualDirectoryBase.&lt;GetAllMatchingFiles&gt;d__0.MoveNext()\r\n   at System.Linq.Enumerable.&lt;SelectManyIterator&gt;d__14`2.MoveNext()\r\n   at System.Linq.Enumerable.&lt;DistinctIterator&gt;d__81`1.MoveNext()\r\n   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()\r\n   at ServiceStack.EnumerableExtensions.Each[T](IEnumerable`1 values, Action`1 action)\r\n   at ServiceStack.Razor.Managers.RazorViewManager.Init()\r\n   at ServiceStack.Razor.RazorFormat.Init()\r\n   at ServiceStack.Razor.RazorFormat.Register(IAppHost appHost)\r\n   at ServiceStack.ServiceStackHost.LoadPlugin(IPlugin[] plugins)",
              "Errors": []
          }
      ],
  </code></pre>
  
  <p>On closer inspection, the folders underneath /packages are all symlinks to the original libraries in the system cache (more info here: <a href="https://www.dartlang.org/tools/pub/faq.html" rel="nofollow">https://www.dartlang.org/tools/pub/faq.html</a>).</p>
  
  <p>Seems like ServiceStack is tripping up on these symlinks.</p>