2

I converted my MVC - 3 project to MVC - 4 project by following this tutorial. I just created new MVC - 4 project , copy all existing controllers, views, models, contents from MVC - 3 project to newly created project. Then completed all manually conversion steps from the tutorial. Now after doing all this when i run MVC - 4 project i got this following exception page :

Can anybody please explain me how to solve this issue?

enter image description here

2 Answers 2

3

The class name in the inherits attribute in the Global.asax (right click view markup) should match the class name and namespace in the Global.asax.cs

Right now you have

<%@ Application Codebehind="Global.asax.cs" 
                Inherits="SiteBuilderAzure_MVC_4.MvcApplication" Language="C#" %>

But I guess in your Global.asax.cs you have your MvcApplication in different namespace:

namespace SomeOtherNamespace
{
    public class MvcApplication : System.Web.HttpApplication
    {
    }
}

So just make sure that you use the correct MvcApplication namespace in your Inherits

Sign up to request clarification or add additional context in comments.

1 Comment

I encountered this when the namespace of the MvcApplication had changed, but what is in the Global.asax didn't change.
-1

i also facing same problem just remove unwanted file and clean the solution and rebuild it

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.