Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make ASP.NET MVC work in IIS 6?

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.

Currently the main "/" URL answers with:

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

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

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. 
like image 586
Jader Dias Avatar asked Mar 09 '09 22:03

Jader Dias


4 Answers

Phil Haack has a pretty good writeup here

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

like image 102
Jason Avatar answered Oct 05 '22 15:10

Jason


I had the similar issue.

  1. I recently upgraded my server to support .net framework 4.0.
  2. Converted my application to support .net fx 4.0.
  3. Deployed the application on sever and trying to test .. I get "HTTP Error 404 - File or directory not found"

Solution

  1. Open IIS Manager, expand the master server node (i.e, the Servername node), and then select the Web service extensions node.
  2. In the right pane of IIS Manager, right-click the extension "ASP.NET v4.0.*".
  3. Click the Allow button.
like image 28
Dhanaji Avatar answered Oct 05 '22 15:10

Dhanaji


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.

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:

<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.

-E

like image 36
eduncan911 Avatar answered Oct 05 '22 15:10

eduncan911


I also encountered this problem, in my case the solution was to uninstall the 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.

like image 21
Alan Heywood Avatar answered Oct 05 '22 15:10

Alan Heywood