Leke Okewale
Leke Okewale

Reputation: 15

Parser Error Message: Could not load type 'ObamPortal.Web.MvcApplication'

Source Error:

*****Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="ObamPortal.Web.MvcApplication" Language="C#" %>*****

Source File: /global.asax Line: 1

I get this error when I am trying to debug an ASP.NET MVC 4.0 application using Visual Studio 2012. All the recommendations I saw here were for already deployed applications. Mind you, I am using Windows 7 as OS. How can I fix this?

My global.asax.cs is:

using ObamPortals.Core.Domain.Modules;
using ObamPortal.Web.Modules; 

namespace ObamPortal.Web 
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit go.microsoft.com/?LinkId=9394801 

    public class MvcApplication : System.Web.HttpApplication
    {
        public override void Init() 
        {
        }

        protected void Application_Start()
        {
        }
    }
} 

Upvotes: 1

Views: 6562

Answers (2)

Mark Fitzpatrick
Mark Fitzpatrick

Reputation: 1624

Did the app compile properly? Usually the Inherits would include Global in it as : ObamPortal.Web.MvcApplication.Global

You need to make sure the Inherits matches exactly the namespace and class of the global.ascx.cs file.

Upvotes: 3

Binson Eldhose
Binson Eldhose

Reputation: 749

Try this following steps (any)

1.) Close IDE and reopen

2.) Perform a clean build

3.) change the output path in project settings for the web app to Bin (rather than bin/x86/Debug)

Upvotes: 4

Related Questions