I am trying to deploy my web project and I keep getting this error:
Line 1: <%@ Application Codebehind=“Global.asax.cs” Inherits=“nadeem.MvcApplication” Langu
Make sure the Inherits is pointing to the right namespace of the class because when you create an MVC project under a solution the Inherits value will miss the project name. Therefore you need to fill the gap(project name) manually.
<br><br><%@ Application Codebehind="Global.asax.cs" Inherits="solutionName.projectName.MvcApplication" Language="C#" %>
I was also getting this error, I deleted dlls from my debug folder and when I started a new instance for debug I got this error. For me the issue was due to the the build setting, Release was selected in the build type, I just changed it to debug and then application was working fine
In my case my site on IIS was pointing to a different project than the one I was running on visual studio.
I found that this problem happened to me and to a colleague after changing the name of our solution/project.
The issue resulting from my colleague: I pulled changes into my branch and had the error. In my bin folder I found the old .dll files sitting with the newly named .dll files. Deleted the old ones and the problem went away.
I'd a similar problem in WebAPI (related MVC).
I fixed with:
Adding ".Global" to inherits in .asax file (not asax.cs)
Inherits="mynamespace.WebAPI.Global"
and changing the public class (asax.cs)
public class Global : System.Web.HttpApplication
In my case, it was also caused by old dlls. Clean all your files then rebuild.