title: Getting an error serving images from App_Themes when using precompilation?
body: <p>I have an ASP.NET site with both WebForms and MVC sections to it.  When I try to precompile the site, everything works except serving images/css from under App_Themes.</p>
  
  <p>If I request something like <code>/foo/App_Themes/themeName/my.png</code>, I get this error:</p>
  
  <pre><code>The file '/foo/App_Themes/themeName/my.png.cshtml' is in the special directory 'App_Themes', which is not allowed.
  </code></pre>
  
  <p>I only get this when precompiling, it works fine otherwise.  Presumably MVC routing is interfering somehow, but I don't know why or how to disable it.</p>
  
  <p>In case it's helpful, here's the stack trace:</p>
  
  <pre><code>System.Web.Compilation.BuildManager.ValidateVirtualPathInternal(VirtualPath virtualPath, Boolean allowCrossApp, Boolean codeFile) +9930801
  System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +455
  System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
  System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +165
  System.Web.Compilation.BuildManager.GetObjectFactory(String virtualPath, Boolean throwIfNotFound) +33
  System.Web.WebPages.BuildManagerWrapper.GetObjectFactory(String virtualPath) +26
  System.Web.WebPages.BuildManagerWrapper.ExistsInPrecompiledSite(String virtualPath) +80
  System.Web.WebPages.BuildManagerWrapper.Exists(String virtualPath) +13
  System.Web.WebPages.&lt;&gt;c__DisplayClass1.&lt;Exists&gt;b__0(IVirtualPathFactory factory) +15
  System.Linq.Enumerable.Any(IEnumerable`1 source, Func`2 predicate) +146
  System.Web.WebPages.VirtualPathFactoryManager.Exists(String virtualPath) +73
  System.Web.WebPages.DefaultDisplayMode.GetDisplayInfo(HttpContextBase httpContext, String vir tualPath, Func`2 virtualPathExists) +42
  System.Web.WebPages.&lt;&gt;c__DisplayClassb.&lt;GetDisplayInfoForVirtualPath&gt;b__8(IDisplayMode mode) +22
  System.Linq.WhereSelectListIterator`2.MoveNext() +104
  System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +94
  System.Web.WebPages.DisplayModeProvider.GetDisplayInfoForVirtualPath(String virtualPath, HttpContextBase httpContext, Func`2 virtualPathExists, IDisplayMode currentDisplayMode, Boolean requireConsistentDisplayMode) +204
  System.Web.WebPages.WebPageRoute.GetRouteLevelMatch(String pathValue, IEnumerable`1 supportedExtensions, IVirtualPathFactory virtualPathFactory, HttpContextBase context, DisplayModeProvider displayModeProvider) +201
  System.Web.WebPages.WebPageRoute.MatchRequest(String pathValue, IEnumerable`1 supportedExtensions, IVirtualPathFactory virtualPathFactory, HttpContextBase context, DisplayModeProvider displayModes) +281
  System.Web.WebPages.WebPageRoute.DoPostResolveRequestCache(HttpContextBase context) +235
  System.Web.WebPages.WebPageHttpModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +89
  System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +69 
  </code></pre>