IIS7 - Virtual Directories' Parent Paths behaving differently than previous versions
Posted
by MisterZimbu
on Server Fault
See other posts from Server Fault
or by MisterZimbu
Published on 2010-06-14T13:03:27Z
Indexed on
2010/06/14
13:13 UTC
Read the original article
Hit count: 451
I'm doing a migration of a web server running on IIS 5 to IIS 7. I'm noticing that the virtual directories are behaving differently between the two.
I have a site located at c:\inetpub\SiteName. This site contains a virtual directory "bob" that points at c:\virtualdirs\bob. There's a script in the bob folder (script.asp) that contains just:
<!--#include virtual="../index.asp"-->
I'm noticing different behaviors between IIS5 and IIS7 when I attempt to run the script by going to http://SiteName/bob/script.asp:
IIS5 references the parent path of the site, and imports c:\inetpub\SiteName\index.asp. IIS7 references the parent folder of the virtual directory, and looks for a c:\virtualdirs\index.asp (that doesn't exist). Doing a Response.Write of a Server.MapPath confirms this.
Is there a way to get IIS7 to behave like IIS5 in this regard? Unfortunately, moving index.asp and its logic into the virtualdirs folder isn't an option as the virtual directory will be shared across many sites (with differing index.asps).
Thanks.
© Server Fault or respective owner