【问题标题】:How to make ASP.NET MVC work in IIS 6?如何使 ASP.NET MVC 在 IIS 6 中工作?
【发布时间】:2010-10-12 07:26:51
【问题描述】:

我已经在 Windows Server 2003 R2 机器中安装了 .NET Framework 3.5 SP1 和 ASP.NET MVC CTP,但我的 ASP.NET MVC 站点仍然无法在该服务器上运行。我在 Internet 和 IIS 上搜索解决方案,我注意到我不能为我的虚拟目录选择除 2.0 之外的其他 .NET Framework 版本。我几乎可以肯定,如果我纠正这个问题,我可以让我的网站在那里工作。

目前主要的“/”网址回答为:

Directory Listing Denied
This Virtual Directory does not allow contents to be listed.

“/Default.aspx”URL 的答案是:

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Section or group name 'system.web.extensions' is already defined. 

【问题讨论】:

    标签: asp.net-mvc iis-6 windows-server-2003


    【解决方案1】:

    【讨论】:

      【解决方案2】:

      除了杰森的回答,常见的要找的是:

      • 启用通配符映射并将其指向 Phil 在 Jason 的链接中提到的 aspnet 程序集。

      您遇到的 /default.aspx 错误似乎是 web.config 配置错误。在 web.config 的最顶部,查找:

      <sectionGroup name="system.web.extensions" 
      

      很可能它被定义了两次。您只需要您拥有的 RC 版本的参考。如果您需要确切的 RC 引用,请在临时文件夹中创建一个新的 ASP.NET MVC Web 项目。然后从中获取 web.config。

      -E

      【讨论】:

      • 我还没有找到它在其他地方定义的位置,但是我不得不从我的 Web.Config 中删除这一部分,然后它才起作用。但杰森的小费也帮助了我。
      【解决方案3】:

      我也遇到了这个问题,我的解决方案是卸载 ASP.NET MVC Beta。

      我尝试运行的应用程序部署了版本 1 MVC dll bin,一旦卸载 Beta,它就一切正常。

      【讨论】:

        【解决方案4】:

        我有类似的问题。

        1. 我最近升级了我的服务器以支持 .net framework 4.0。
        2. 将我的应用程序转换为支持 .net fx 4.0。
        3. 在服务器上部署应用程序并尝试测试.. 我收到“HTTP 错误 404 - 找不到文件或目录”

        解决方案

        1. 打开 IIS 管理器,展开主服务器节点(即 Servername 节点),然后选择 Web 服务扩展节点。
        2. 在 IIS 管理器的右窗格中,右键单击扩展名“ASP.NET v4.0.*”。
        3. 单击“允许”按钮。

        【讨论】:

          【解决方案5】:

          类似问题:我们尝试在 IIS6 机器上安装 MVC4/.NET 4 应用程序,按照描述设置所有内容,但出现相同错误:

          Directory Listing Denied
          This Virtual Directory does not allow contents to be listed.
          

          对我们来说,最后的解决办法是将 UrlRoutingModule 添加到 web.config:

            <add name="UrlRoutingModule"
                 type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          

          这是有道理的,但我不知道为什么我们需要明确添加它而其他人没有。 (我们是在Sharepoint下的一个目录下运行的,可能是相关的……)

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2011-04-29
            • 1970-01-01
            • 1970-01-01
            • 2011-05-27
            • 1970-01-01
            相关资源
            最近更新 更多