Take the 2-minute tour ×

I am working on an MVC project in Visual Studio 2010 with .NET Framework 4.0 + MVC2 and everything works if I set the target framework to .NET 4.0. However, my host does not offer .NET 4.0 in order to deploy the site I need to get it working on .NET 3.5.

I tried converting it to ASP.NET 3.5 and everything builds just fine except now when I try to load the homepage, I get a 404 Error saying:

The resource cannot be found.


 Requested URL: /home

 Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET  

Anyone know why this is?

Thank You for Your help. TheLorax

share|improve this question
You would prob get a better response to this if you ask it on stackoverflow –  Sam Dec 21 '09 at 10:00
I have a similar question open on StackOverflow: stackoverflow.com/questions/2854808 –  Guy May 19 '10 at 1:14
add comment

3 Answers

From my experience with ASP.NET MVC, I've seen that a Default.aspx page is required for IIS to function correctly. I'm using the page that was included in the ASP.NET MVC 1 template. Unfortunately, the ASP.NET MVC 2 does not include this page (to the best of my knowledge), so you should add the following to your project:


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="YourNamespace._Default" %>



using System.Web;
using System.Web.Mvc;
using System.Web.UI;

namespace YourNamespace
    public partial class _Default : Page
        public void Page_Load(object sender, System.EventArgs e)

            string originalPath = Request.Path;
            HttpContext.Current.RewritePath(Request.ApplicationPath, false);
            IHttpHandler httpHandler = new MvcHttpHandler();
            HttpContext.Current.RewritePath(originalPath, false);
share|improve this answer
add comment

Simple solution: switch to Visual Studio 2008 + SP1 + MVC 1. This is the released/supported combination. If your host doesn't install the MVC assemblies then they can be deployed side by side, you will need to ensure your host has .NET 3.5 SP1.

If I recall correctly VS2010 B2 includes MVC*2* B2, but not MVC*1*.

share|improve this answer
add comment

It may be that the MVC assemblies are not installed on the server you are publishing to. Try going into your MVC project, then under resources and change the property copy local to true for all MVC specific assemblies (or just highlight everything under references and set this property to true).

share|improve this answer
add comment

Your Answer

