Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure IIS7 to work with an MVC 2.0 Framework 4.0 application

I have an MVC 2.0 application that I'm playing around with in VS2010 which is a .Net Framework 4.0 application, which works great on my local dev machine, but fails when IIS gets involved, giving me all sorts of IIS errors.

Can someone please tell me the sequence of steps I need to do in order to get an application set-up in IIS 7.0 (running on Windows 2008 Server)? The best I can get is it showing me the directory contents of the root of my site. :o(

I've followed various SO links to various posts saying that to stop the 403.14 Forbidden error message, you simply enable directory browsing in IIS for my particular app and it's away, but turning it on simply shows be the root-level structure and not actually running my site.

To confirm, the 2008 Server has .Net Framework 4.0 installed, and I have set the 3x MVC 2.0 dlls to Copy Local = true from within Visual Studio 2010, so that the necessary MVC .dlls are present in the bin folder. I have an MVC 1.0 application running on that machine (made using VS2008) but can't seem to get this 2.0 app working

like image 422
Brett Rigby Avatar asked Dec 27 '09 15:12

Brett Rigby


People also ask

How do I enable web management services?

In the center pane, under Management, double-click Management Service. In the center pane, select Enable remote connections. If the Web Management Service is already running, you'll need to stop it first. In the Actions pane, click Start to start the Web Management Service.


2 Answers

Check that the IIS7 App Pool that contains the MVC application is the .NET 4 App Pool and not a .NET 2 App Pool.

  1. In the IIS Manager select the Web Site (e.g. "Default Web Site")
  2. In the Actions panel choose "Advanced Settings"
  3. In that dialog there is a list of properties. Select "Application Pool" and click the "..." button next to it
  4. Ensure that the selected application pool is using .NET version 4.0
like image 193
Eilon Avatar answered Nov 02 '22 23:11

Eilon


  • On IIS 7- on the left panel choose the application pool
  • On the right panel(Action) click the set application pooldefaults
  • On General tab choose .Net frameWork 4.0.
like image 29
Ziv.Ti Avatar answered Nov 02 '22 23:11

Ziv.Ti