Question

I have a msdeployed site, which will contain a virtual directory to a separate folder of content. when I host non pre-compiled (I.E. my IIS hosting website points to my project directory in Visual Studio).

On my local machine, I can redirect to a html page within the virtual directory, and the html page is displayed correctly. BUT, when I deploy the project to our staging server, I get the following error:

The file '/MedrioWeb/help/info/default.html' has not been pre-compiled, and cannot be requested. 
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
   at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
   at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
   at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String virtualPath, String path)
   at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)   

In the main, precompiled web application in IIS, I added the following extensions to the compilation\buildProviders:

<!-- forcing authentication for html pages -->
<add extension=".html" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".htm" type="System.Web.Compilation.PageBuildProvider" />

Next, I have a web.config in the virtual directory under the web application:

<?xml version="1.0"?>
<configuration>
    <system.web>

    </system.web>
  <system.webServer>
    <handlers>
         <add name="HTML" path="*.html" verb="GET, HEAD, POST, DEBUG"   type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" requireAccess="Script" />
         <add name="HTM" path="*.htm" verb="GET, HEAD, POST, DEBUG" type="System.Web.UI.PageHandlerFactory" resourceType="Unspecified" requireAccess="Script" />
     </handlers>
  </system.webServer>
</configuration>

TL;DR: I am getting and pre-compiled error for a non asp.net file type. I am only including the extension so that my custom form authentication module is used to verify the user is logged into see the html page. Why is this not working with the precompiled code, vs my non pre-compiled version on my local machine?

Was it helpful?

Solution

Ok, No biters?

I ended up removing our builds pre-compile task.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top