Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you allow parent paths in Visual Studio 2013?

I am converting a classic ASP site to a Visual Studio 2013 MVC project. When I run the classic ASP code inside of the Visual Studio 2013 debugger I get an error message:

Active Server Pages error 'ASP 0131' Disallowed Parent Path

The question is: how can I enable parent paths in the VS2013 debugger?

FYI - This is not IISExpress and enabling parent paths is different.

like image 637
Mike G Avatar asked Feb 13 '15 18:02

Mike G


2 Answers

I discovered the answer myself. Here is how I did it.

  1. I opened Task Manager and saw that Visual Studio was running processes of IISExpress for the web server functionality.
  2. I clicked on Start and entered IISExpress to find out where it was installed. To my surprise, but an obvious choice, it was located in documents.
  3. I opened the C:\Users\Mike\Documents\IISExpress\config folder then opened Notepad as an administrator.
  4. I then opened the applicationhost.config file and under the <system.webServer> element there is an <asp> element. I modified it to read. <asp scriptErrorSentToBrowser="true" enableParentPaths="true">
  5. I then opened by MVC solution and ran the Classic ASP program without any problems. Everything works!
like image 186
Mike G Avatar answered Sep 20 '22 13:09

Mike G


I have Visual Studio 2015 and I had to do something else.

Right-click on the IIS Express icon in your tray while the application is running, and select Show All Applications.

Click on the application you want to manage. You'll see the location of the IIS Express server config file in the details section below.

Edit it as administrator and add enableParentPaths="true" to the asp XML element (under system.webServer), as in the Mike G's answer.

For me, the config file was located in SolutionDir\.vs\config\applicationhost.config.

like image 39
GregRos Avatar answered Sep 23 '22 13:09

GregRos