1
votes

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()
        {
        }
    }
} 
2
Do you have a Global.asax.cs file to go with the Global.asax? - DavidG
yes. i have Global.asax.cs - Leke Okewale
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() { } } } - Leke Okewale

2 Answers

4
votes

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)

3
votes

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.