Wednesday, February 3, 2010

Classic ASP - AspEnableParentPaths

I was debugging some Classic ASP code recently, as part of building out a new development server, and I ran across an error that I hadn't seen before:

The Include file '../MyFolder/Includes/MyPage.asp' cannot contain '..' to indicate the parent directory.

The answer here is very simple, but not obvious if you haven't had to deal with it.  There is a setting in IIS called AspEnableParentPaths, which allows for this use of parent directory references.  Back in IIS5, this was enabled by default, but starting in IIS6, it was disabled by default for security reasons.  This makes sense, especially as use of classic ASP tapers off.  However, if you inherit some old code, it can pop up and cause an error, as it did for me.

Here are a couple of links to instructions for configuring this setting in IIS6 and IIS7, respectively.

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/40993ff2-22c3-48a9-ba01-1056a9425a1e.mspx?mfr=true

http://blogs.iis.net/bills/archive/2007/05/21/tips-for-classic-asp-developers-on-iis7.aspx

No comments: