My co worker and I have a small site that is working fine on the little development server, but we've been unable to get it running on our existing IIS 6 server.
The IIS 6 machine has .NET 3.5 on it. We also installed the MVC Preview 2 install on the IIS 6 machine and added a .mvc mapping to IIS.
We aren't able to hit any of our routes. The default page comes up fine, so we know that the framework itself is working (ie - it's reading the routes in Global, running the controller code, forwarding to the view), but we can't hit any of our other routes.
Are we missing something here?
In iis6 you have to add an extension that will foward the request to the ASP.net ISAPI dll (.mvc, .aspx) or forward all requests the the ASP.net ISAPI dll using a wildcard application map.
You can add a wildcard application map in iis from properties - home directory - configuration
Note, you can manage without the .mvc using a wildcvard mapping, but this means handling all non-ASP.NET file types (.css, .html, .js, ...) within ASP.NET (i.e. create handlers) as well.
Richard
Marked as answer by tobinibot on Apr 03, 2008 02:01 PM
tobinibot
Member
1 Points
3 Posts
Deploying on IIS 6
Apr 02, 2008 09:32 PM|LINK
My co worker and I have a small site that is working fine on the little development server, but we've been unable to get it running on our existing IIS 6 server.
The IIS 6 machine has .NET 3.5 on it. We also installed the MVC Preview 2 install on the IIS 6 machine and added a .mvc mapping to IIS.
We aren't able to hit any of our routes. The default page comes up fine, so we know that the framework itself is working (ie - it's reading the routes in Global, running the controller code, forwarding to the view), but we can't hit any of our other routes. Are we missing something here?
Thanks,
Tobin
iis6 mvc deploy routes
rjcox
Contributor
7064 Points
1444 Posts
Re: Deploying on IIS 6
Apr 03, 2008 07:33 AM|LINK
What are your routes? (Do they contain an .mvc extension? See the comment in the default global.asax.cs from the project template.)
srulyt
Participant
1073 Points
230 Posts
Re: Deploying on IIS 6
Apr 03, 2008 10:05 AM|LINK
In iis6 you have to add an extension that will foward the request to the ASP.net ISAPI dll (.mvc, .aspx) or forward all requests the the ASP.net ISAPI dll using a wildcard application map.
You can add a wildcard application map in iis from properties - home directory - configuration
tobinibot
Member
1 Points
3 Posts
Re: Deploying on IIS 6
Apr 03, 2008 12:22 PM|LINK
Here's the thing, my routes don't specify a controller.
Here a few of my routes
routes.Add(new Route("flight/{flightNumber}", new MvcRouteHandler()) { Defaults = new RouteValueDictionary(new { controller = "Flights", action = "GetFlightForToday", flightNumber = "" }), }); routes.Add(new Route("flight/{date}/{flightNumber}", new MvcRouteHandler()) { Defaults = new RouteValueDictionary(new { controller = "Flights", action = "GetFlight", date = DateTime.Today.ToString("MM/dd/yyyy"), flightNumber = "" }), }); routes.Add(new Route("flights", new MvcRouteHandler()) { Defaults = new RouteValueDictionary(new { controller = "Flights", action = "GetAllFlights"}), }); routes.Add(new Route("flights/active", new MvcRouteHandler()) { Defaults = new RouteValueDictionary(new { controller = "Flights", action = "GetActiveFlights" }), });rjcox
Contributor
7064 Points
1444 Posts
Re: Deploying on IIS 6
Apr 03, 2008 12:43 PM|LINK
With IIS6 you need a .mvc extension in each route so IIS6 knows to let ASP.NET process the request.
So rather than:
"flight/{flightNumber}""flight/{date}/{flightNumber}"
"flights"
"flights/active"
you need:
"flight.mvc/{flightNumber}""flight.mvc/{date}/{flightNumber}"
"flights.mvc"
"flights.mvc/active"
Note, you can manage without the .mvc using a wildcvard mapping, but this means handling all non-ASP.NET file types (.css, .html, .js, ...) within ASP.NET (i.e. create handlers) as well.
tobinibot
Member
1 Points
3 Posts
Re: Deploying on IIS 6
Apr 03, 2008 02:00 PM|LINK
That worked Richard, thanks so much.