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

前端 未结 22 2943
灰色年华
灰色年华 2021-02-19 15:16

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         


        
相关标签:
22条回答
  • 2021-02-19 15:58

    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#" %>
    
    0 讨论(0)
  • 2021-02-19 15:59

    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

    0 讨论(0)
  • 2021-02-19 15:59

    In my case my site on IIS was pointing to a different project than the one I was running on visual studio.

    0 讨论(0)
  • 2021-02-19 16:01

    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.

    0 讨论(0)
  • 2021-02-19 16:04

    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
    
    0 讨论(0)
  • 2021-02-19 16:05

    In my case, it was also caused by old dlls. Clean all your files then rebuild.

    0 讨论(0)
提交回复
热议问题