如何在 IIS Express Config 中设置允许父路径

发布于 2024-10-13 17:52:29 字数 96 浏览 9 评论 0原文

我假设这在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

望笑 2024-10-20 17:52:29

浏览到 C:\Documents and Settings\$您的用户名$\My Documents\IISExpress\config

打开 applicationHost.config

找到 部分

部分如下...
默认情况下,它只有缓存和空限制位,但可以随意调整您不需要的任何参数。

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

     <session allowSessionState="true" />
     <cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
     <limits />
</asp>

保存并重新启动iis express。

Browse to C:\Documents and Settings\$your user name$\My Documents\IISExpress\config

Open applicationHost.config

Find the <system.webServer> section

Change 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.

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

     <session allowSessionState="true" />
     <cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
     <limits />
</asp>

Save and restart iis express.

路还长,别太狂 2024-10-20 17:52:29

以下内容应该可以帮助您继续前进。

  • 在 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

征棹 2024-10-20 17:52:29

如果我不是唯一一个在 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.

飘然心甜 2024-10-20 17:52:29

就我而言,我从命令行运行 iisexpress ,@Flapper 的解决方案和其他一些解决方案不起作用,然后我注意到 iisexpress 输出模板配置路径从命令行运行时:

> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:%cd% /port:8080 /clr:v2.0

输出:

Copied template config file 'C:\Program Files (x86)\IIS Express\AppServer\applicationhost.config' to 'C:\Users\rcdmk\AppData\Local\Temp\iisexpress\applicationhost20244285325599.config'
Updated configuration file 'C:\Users\rcdmk\AppData\Local\Temp\iisexpress\applicationhost20244285325599.config' with given cmd line info.
Starting IIS Express ...
Successfully registered URL "http://localhost:8080/" for site "Development Web Site" application "/"
Registration completed
IIS Express is running.
Enter 'Q' to stop IIS Express

我使用 @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 noticed iisexpress outputs the template config path when running from the command-line:

> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:%cd% /port:8080 /clr:v2.0

Which outputs:

Copied template config file 'C:\Program Files (x86)\IIS Express\AppServer\applicationhost.config' to 'C:\Users\rcdmk\AppData\Local\Temp\iisexpress\applicationhost20244285325599.config'
Updated configuration file 'C:\Users\rcdmk\AppData\Local\Temp\iisexpress\applicationhost20244285325599.config' with given cmd line info.
Starting IIS Express ...
Successfully registered URL "http://localhost:8080/" for site "Development Web Site" application "/"
Registration completed
IIS Express is running.
Enter 'Q' to stop IIS Express

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文