omri omri - 1 year ago 503
ASP.NET (C#) Question

IIs Error: Application Codebehind=“Global.asax.cs” Inherits=“nadeem.MvcApplication”

I am trying to deploy my web project and I keep getting this error:

Line 1: <%@ Application Codebehind=“Global.asax.cs” Inherits=“nadeem.MvcApplication” Language=“C#” %>

I looked at this post: Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="nadeem.MvcApplication" Language="C#" %>

But it is currect in my project.

I suspect it something with my iis7 configuration.

Any ideas?


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


namespace TamalTest
using System;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

public class MvcApplication : HttpApplication
protected void Application_Start()

public static void RegisterGlobalFilters(GlobalFilterCollection filters)
filters.Add(new HandleErrorAttribute());

public static void RegisterRoutes(RouteCollection routes)


Answer Source

Solved, just renamed the Global.asax or delete it fixed the problem :/

Other known related bugs I found on the web:

  1. Global.asax.cs: must inherit from HttpApplication -> public class MvcApplication : HttpApplication
  2. Project output must be the bin folder and not Bin/Debug, etc.
  3. Iss application pool is not in the correct .net version.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download