Gaurav
Gaurav

Reputation: 8487

Parser error in MVC project

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

Upvotes: 2

Views: 4836

Answers (2)

wtwww
wtwww

Reputation: 1

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

Upvotes: -1

nemesv
nemesv

Reputation: 139758

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

Upvotes: 3

Related Questions