如何使ASP.NET MVC在IIS 6中工作?

时间:2021-12-11 03:34:33

I have installed .NET Framework 3.5 SP1 and ASP.NET MVC CTP in a Windows Server 2003 R2 box, but my ASP.NET MVC site still doesn't work on that server. I was searching the internet and IIS for a solution and I noted that I can't choose other .NET Framework version besides 2.0 for my virtual directories. I'm almost sure if I correct this I can make my site work there.

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

Currently the main "/" URL answers with:

目前主要的“/”URL回答:

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

And the "/Default.aspx" URL answers with:

而“/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. 

5 个解决方案

#1


11  

Phil Haack has a pretty good writeup here

Phil Haack在这里写得非常好

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

#2


3  

I had the similar issue.

我有类似的问题。

  1. I recently upgraded my server to support .net framework 4.0.
  2. 我最近升级了我的服务器以支持.net framework 4.0。
  3. Converted my application to support .net fx 4.0.
  4. 转换我的应用程序以支持.net fx 4.0。
  5. Deployed the application on sever and trying to test .. I get "HTTP Error 404 - File or directory not found"
  6. 在服务器上部署应用程序并尝试测试..我得到“HTTP错误404 - 找不到文件或目录”

Solution

  1. Open IIS Manager, expand the master server node (i.e, the Servername node), and then select the Web service extensions node.
  2. 打开IIS管理器,展开主服务器节点(即Servername节点),然后选择Web服务扩展节点。
  3. In the right pane of IIS Manager, right-click the extension "ASP.NET v4.0.*".
  4. 在IIS管理器的右窗格中,右键单击扩展“ASP.NET v4.0。*”。
  5. Click the Allow button.
  6. 单击“允许”按钮。

#3


2  

Besides Jason's answer, the common things to look for is:

除了杰森的回答,常见的事情是:

  • Enable Wildcard mapping and point it to the aspnet assembly Phil mentions in Jason's link.
  • 启用通配符映射并将其指向在Jason的链接中提到的aspnet程序集。

The /default.aspx error you are getting seems to be a web.config configuration error. At the very top of your web.config, look for:

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

<sectionGroup name="system.web.extensions" 

Most likely it is defined twice. You only need the reference for the RC build you have. If you need the exact RC references, create a new ASP.NET MVC Web Project in a temp folder. And then grab the web.config from it.

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

-E

-E

#4


1  

I also encountered this problem, in my case the solution was to uninstall the ASP.NET MVC Beta.

我也遇到过这个问题,在我的例子中,解决方案是卸载ASP.NET MVC Beta。

The application I was trying to get working had the version 1 MVC dlls bin deployed and once the Beta was uninstalled it all worked fine.

我试图使用的应用程序部署了版本1 MVC dll bin,一旦Beta被卸载,它一切正常。

#5


0  

Similar issue: We tried to install an MVC4/.NET 4 app on an IIS6 box, set up everything as described, and got same error:

类似的问题:我们试图在IIS6盒子上安装一个MVC4 / .NET 4应用程序,按照描述设置所有内容,并得到同样的错误:

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

For us, the final fix was to add the UrlRoutingModule to the web.config:

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

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

Which makes sense, but I don't know why we needed to explicitly add it and others didn't. (We are running in a directory under Sharepoint, maybe related...)

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

#1


11  

Phil Haack has a pretty good writeup here

Phil Haack在这里写得非常好

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

#2


3  

I had the similar issue.

我有类似的问题。

  1. I recently upgraded my server to support .net framework 4.0.
  2. 我最近升级了我的服务器以支持.net framework 4.0。
  3. Converted my application to support .net fx 4.0.
  4. 转换我的应用程序以支持.net fx 4.0。
  5. Deployed the application on sever and trying to test .. I get "HTTP Error 404 - File or directory not found"
  6. 在服务器上部署应用程序并尝试测试..我得到“HTTP错误404 - 找不到文件或目录”

Solution

  1. Open IIS Manager, expand the master server node (i.e, the Servername node), and then select the Web service extensions node.
  2. 打开IIS管理器,展开主服务器节点(即Servername节点),然后选择Web服务扩展节点。
  3. In the right pane of IIS Manager, right-click the extension "ASP.NET v4.0.*".
  4. 在IIS管理器的右窗格中,右键单击扩展“ASP.NET v4.0。*”。
  5. Click the Allow button.
  6. 单击“允许”按钮。

#3


2  

Besides Jason's answer, the common things to look for is:

除了杰森的回答,常见的事情是:

  • Enable Wildcard mapping and point it to the aspnet assembly Phil mentions in Jason's link.
  • 启用通配符映射并将其指向在Jason的链接中提到的aspnet程序集。

The /default.aspx error you are getting seems to be a web.config configuration error. At the very top of your web.config, look for:

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

<sectionGroup name="system.web.extensions" 

Most likely it is defined twice. You only need the reference for the RC build you have. If you need the exact RC references, create a new ASP.NET MVC Web Project in a temp folder. And then grab the web.config from it.

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

-E

-E

#4


1  

I also encountered this problem, in my case the solution was to uninstall the ASP.NET MVC Beta.

我也遇到过这个问题,在我的例子中,解决方案是卸载ASP.NET MVC Beta。

The application I was trying to get working had the version 1 MVC dlls bin deployed and once the Beta was uninstalled it all worked fine.

我试图使用的应用程序部署了版本1 MVC dll bin,一旦Beta被卸载,它一切正常。

#5


0  

Similar issue: We tried to install an MVC4/.NET 4 app on an IIS6 box, set up everything as described, and got same error:

类似的问题:我们试图在IIS6盒子上安装一个MVC4 / .NET 4应用程序,按照描述设置所有内容,并得到同样的错误:

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

For us, the final fix was to add the UrlRoutingModule to the web.config:

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

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

Which makes sense, but I don't know why we needed to explicitly add it and others didn't. (We are running in a directory under Sharepoint, maybe related...)

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