如何在Visual Studio 2015中允许父路径?

Tre*_*oks 11 asp-classic visual-studio-2015

我在Visual Studio 2015中从Visual Studio 2013(运行得很好)打开了一个现有的Web应用程序项目.当我从Visual Studio 2015中运行它时,我得到:

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. 
Run Code Online (Sandbox Code Playgroud)

我的IISExpress applicationhost.config文件已包含以下条目:

<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>
Run Code Online (Sandbox Code Playgroud)

我的Web应用程序属性设置为使用IISExpress.

我能错过什么?

thl*_*brg 11

'applicationhost.config'已移动,现在位于隐藏的.vs文件夹中.确保您正在更新正确的文件.


Chr*_*lsh 5

虽然接受的答案是正确的,但这是一个非常明确的解释.

自VS2015以来,IIS Express已经改变了它获取applicationHost.config文件的位置.这可能是为了简化项目的分配.它已经远离传统C:\Users\<profile>\Documents\IISExpress\config\applicationhost.config文件夹(尽管此文件仍将存在于您的计算机上以支持较旧的VS安装).

它现在位于应用程序项目的根文件夹中作为隐藏文件.为了节省您的搜索速度,以下是您快速轻松地打开它的方法:

  1. 右键单击托盘图标中的IIS Express,然后选择" 显示所有应用程序".
  2. 单击应用程序的URL条目.然后,"路径"和"配置"值将在IIS Express窗口中显示为超文本链接.
  3. 单击配置超文本以在首选编辑器上打开.(例如C:\<Path-To-Project>\.vs\config\applicationhost.config)

希望这可以帮助.