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

前端 未结 22 3312
灰色年华
灰色年华 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 16:05

    Problem could occur if you have changed the namespace of your project.

    Change the Namespace from Project Properties and also replace all old Namespace with new ones. Renaming to correct namespace might fix the issue.

    Source

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

    In my case, I copied the project and pasted it as another project. The Global.asax file contains the wrong file name, so I just change

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

    to

    <%@ Application Codebehind="Global.asax.cs" 
        Inherits="RightAppName.MvcApplication" Language="C#" %>
    
    0 讨论(0)
  • 2021-02-19 16:06

    Deleting Global.asax and restarting Visual Studio fixed the problem for me.

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

    It's quite weird. Every time I face this issue, have different solution. This time all of the previous fixes failed then I changed project output path from Bin to ..\Build\Bin. It failed. Reverted output path to the previous value , i.e., Bin fixed the issue.

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

    In my case problem occurred after namespace renaming. I didn't use external tool like Re-sharper, I did renaming manually.

    In that process, Views/Web.config file was left unchanged. After replacing old namespace name with the new one in this file, the error disappeared.

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

    Same issue i faced , when copy the project from another system. In my case i fixed this issue:

    delete everythings from inside Bin folder. Clean & Rebuild the app again

    Hope this will help.

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