将 InheritInChildApplications 添加到 web.config 会导致 500 服务器错误
本文关键字:服务器 错误 config InheritInChildApplications 添加 web | 更新日期: 2023-09-27 18:33:40
我添加到我的web.config文件中。
<configuration>
<location path="." inheritInChildApplications="false">
.....
</location>
</configuration>
在我将其添加到我的 web.config 文件之后。我收到一个一般错误,指出"您要查找的资源有问题,无法显示。asp.net"
我关闭了自定义错误,但仍然看到相同的错误消息。 关于如何解决这个问题的任何想法?
谢谢
问题在于您如何指定 path="."。
假设您希望限制当前目录和所有根目录,您可以简单地完全省略 path 属性:
<location inheritInChildApplications="false"> .... </location>