将InheritInChildApplications添加到web.config会导致500服务器错误

时间:2014-12-09 17:53:38

标签: c# asp.net-mvc web-config

我已添加到我的web.config文件中。

<configuration>
    <location path="." inheritInChildApplications="false">
        .....
    </location>
</configuration>

将我添加到我的web.config文件后。我收到一个通用错误,上面写着“您正在查找的资源存在问题,无法显示.asp.net”

我关闭了customError,但仍然看到相同的错误消息。关于如何解决这个问题的任何想法?

谢谢

1 个答案:

答案 0 :(得分:0)

问题在于你如何指定path =&#34;。&#34;。

假设您希望限制当前目录和所有根目录,您可以简单地省略path属性:

<location inheritInChildApplications="false"> .... </location>