如何在 IIS Express Config 中设置允许父路径
我假设这在 applicationhost.config 文件中是可能的,但我没有看到父路径设置。
如何允许在 IIS Express 下运行的特定站点的父路径?
I'm assuming this is possible in the applicationhost.config file but I did not see a parent paths setting.
How do you allow parent paths for a specific site running under IIS Express?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
浏览到 C:\Documents and Settings\$您的用户名$\My Documents\IISExpress\config
打开 applicationHost.config
找到
部分将
部分如下...默认情况下,它只有缓存和空限制位,但可以随意调整您不需要的任何参数。
保存并重新启动iis express。
Browse to C:\Documents and Settings\$your user name$\My Documents\IISExpress\config
Open applicationHost.config
Find the
<system.webServer>
sectionChange the
<asp>
section to the following…By default it only had the cache and empty limits bits but feel free to adjust any parameters you don't want.
Save and restart iis express.
以下内容应该可以帮助您继续前进。
在 32 位系统上
"%programfiles%\iis express\appcmd" set config "Default Web Site/myapp -section:asp -enableParentPaths:true
在 64 位系统上
"%programfiles(x86)%\iis express\ appcmd" set config "默认网站/myapp -section:asp -enableParentPaths:true
相关 IIS 7 配置参考的链接:http://www.iis.net/ConfigReference/system.webServer/asp
The following should get you going.
On 32bit system
"%programfiles%\iis express\appcmd" set config "Default Web Site/myapp -section:asp -enableParentPaths:true
On 64 bit system
"%programfiles(x86)%\iis express\appcmd" set config "Default Web Site/myapp -section:asp -enableParentPaths:true
Link to related IIS 7 config reference: http://www.iis.net/ConfigReference/system.webServer/asp
如果我不是唯一一个在 2022 AD 使用 Visual Studio 仍然支持 .asp 的人,如果 @Flapper 的答案不起作用,您可能需要更改隐藏的 .vs[解决方案名称]\config 文件夹中的 application.config。
可能发生的情况是,VS 将根 IIS application.config 复制到解决方案的 .vs 中,因此对根的任何更改都不会影响现有的解决方案配置。就我而言,我必须更改解决方案 .config 以及根 IIS .config 才能使其正常工作。
If I'm not the only one still supporting .asp in 2022 AD with Visual Studio you may need to change the application.config in the hidden .vs[solution name]\config folder if the answer by @Flapper does not work.
What might be happening is that VS copies the root IIS application.config into .vs for the solution so any changes to the root would not impact an existing solution config. In my case I had to change the solution .config as well as the root IIS .config for it to work.
就我而言,我从命令行运行
iisexpress
,@Flapper 的解决方案和其他一些解决方案不起作用,然后我注意到iisexpress
输出模板配置路径从命令行运行时:输出:
我使用 @Flapper 的配置更新了位于
C:\Program Files (x86)\IIS Express\AppServer\applicationhost.config
的模板文件,并重新启动了服务器,然后就可以了。In my case, I'm runninig
iisexpress
from the command-line and @Flapper's solution and a few others didn't work, then I noticediisexpress
outputs the template config path when running from the command-line:Which outputs:
I updated that template file, located at
C:\Program Files (x86)\IIS Express\AppServer\applicationhost.config
with @Flapper's config and restarted the server, then it worked.