[Mono-aspnet-list] Bug With Default Index Files (MonoServerDefaultIndexFiles) and Pre-compiled Sites with Xsp2

Dave Glick dglick at dracorp.com
Sat Feb 5 07:51:32 EST 2011


> AFAIR, precompiling does not remove the .aspx et al. It just strips them out of content and leaves one line saying that the file is a place holder... So 'Default.aspx' should be there with that line but the actual class is loaded from the 'bin' directory.

That's close, but not quite right. It puts all the precompiled placeholders in the /bin directory rather than their original location and gives them all pseudo-random names to avoid name collisions. Inside the file it contains the location that the file would have been had it not been precompiled. For example, for my root Default.aspx file I ended up with a file named default.aspx.cdcab7d2.compiled in /bin with the following content (notice the virtualPath attribute):

<?xml version="1.0" encoding="utf-8"?>
<preserve resultType="3" virtualPath="/Default.aspx" hash="fffffffe9342ac25" filehash="100f2d1bac72641f" flags="110000" assembly="WebAppDeploy" type="ASP.default_aspx">
  <filedeps>
    <filedep name="/Default.aspx" />
    <filedep name="/Main.Master" />
  </filedeps>
</preserve>

I guess one way to resolve this bug would be after checking the physical file system to look in the /bin directory for all .compiled files with the name of each default index file, open them, and check if the virtualPath attribute matches the request. It's kind of a hacky fix, but it would probably work. I would think that the web framework caches all the .compiled information though, and there's a better way to check if the site is precompiled and contains a page at the appropriate virtual path. I just don't know what it is :)

-Dave


More information about the Mono-aspnet-list mailing list