Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you allow parent paths in Visual Studio 2015?

I've opened an existing web application project from Visual Studio 2013 (which runs just fine), in Visual Studio 2015. When I run it from within Visual Studio 2015 I get:

Active Server Pages error 'ASP 0131' 

Disallowed Parent Path 

/blah/login.asp, line 1 

The Include file '../includes/Security.asp' cannot contain '..' to indicate the parent directory. 

My IISExpress applicationhost.config file already contains the entry:

<asp appAllowClientDebug="false" appAllowDebugging="false" errorsToNTLog="false" enableParentPaths="true" scriptErrorSentToBrowser="true" bufferingOn="true">

            <session allowSessionState="true" />
            <cache diskTemplateCacheDirectory="%SystemDrive%\inetpub\temp\ASP Compiled Templates" />
            <limits maxRequestEntityAllowed="1073741824" />
        </asp>

My web application properties are set to use IISExpress.

What could I be missing?

like image 451
TrevorBrooks Avatar asked Jul 22 '15 15:07

TrevorBrooks


People also ask

How to enable parent paths in IIS?

You can enable or disable parent paths by using IIS Manager. To do so, open IIS Manager and navigate to the site or application where you want to configure parent paths, and then-double click the ASP feature. In the list of ASP features, configure the Enable Parent Paths option.

How can I disable parent paths in IIS?

Log into the IIS Administration Console. Open the Directory Browsing section. Select On or Off to enable or disable the Parent Paths option. Click Set Parent Paths to save your setting.


2 Answers

The 'applicationhost.config' has moved and is now located in the hidden .vs folder. Make sure you're updating the right file.

like image 189
thllbrg Avatar answered Oct 19 '22 11:10

thllbrg


Here is a much clear explaination although the accepted answer is in the right direction.

Since VS2015, IIS Express has changed where it picks up your applicationHost.config file. This is presumably to simplify the distribution of projects. It has moved away from the traditional C:\Users\<profile>\Documents\IISExpress\config\applicationhost.config folder (although this file will still exist on your computer to support older VS installations).

It is now located in the application project's root folder as a hidden file. To save you hunting for it, here is how you open it quickly and easily:

  1. Right click IIS Express from the tray icon and select Show All Applications.
  2. Click on the URL entry of your application. The "Path" and "Config" values then are shown as hypertext links further down in the IIS Express window.
  3. Click on the Config hypertext to open on your preferred editor. (e.g. C:\<Path-To-Project>\.vs\config\applicationhost.config)

Hope this helps.

like image 5
Chris Walsh Avatar answered Oct 19 '22 12:10

Chris Walsh