通过 IIS 运行 MVC 应用程序会导致“目录列表被拒绝”

发布于 2024-07-06 10:45:12 字数 167 浏览 8 评论 0原文

我有一个 .Net MVC 应用程序,如果我使用 Visual Studio Webserver 中的构建,它可以正常运行。 如果我使用项目属性页切换到 IIS 作为 Web 服务器并为我的项目创建虚拟目录,则我发送到服务器的任何请求都会导致“目录列表被拒绝”失败。

有谁知道这个问题的解决方案?

I have an .Net MVC application which runs fine if I use the build in Visual Studio Webserver. If I use the projects property pages to switch to IIS as the webserver and create a virtual directory for my project, any request I send to the server results in a "Directory listing denied" failure.

Does anyone know a solution for this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

幼儿园老大 2024-07-13 10:45:12

这是 IIS7 之前的“无扩展名”URL 的问题。

它需要 ISAPI 过滤器或路由表中具有 .mvc 扩展名的重复路由。 请尝试 ScottGu 的博客 weblogs.asp.net。

It's an issue with 'extensionless' urls prior to IIS7.

It needs either an ISAPI filter or duplicate routes in the routing table with a .mvc extension. Try ScottGu's blog at weblogs.asp.net.

夏有森光若流苏 2024-07-13 10:45:12

可能是 IIS 没有将 default.aspx 设置为起始页。

Might be the IIS does not have default.aspx set up as a start page.

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