Error: «Could not load type MvcApplication»

后端 未结 30 1770
心在旅途
心在旅途 2020-11-28 02:18

I am getting the error

Could not load type MvcApplication

when I try to run my website.

How to correct it?

30条回答
  •  青春惊慌失措
    2020-11-28 02:47

    Check code behind information, provided in global.asax. They should correctly point to the class in its code behind.

    sample global.asax:

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

    sample code behind:

       namespace MyApplicationNamespace
        {
            public class MyMvcApplication : System.Web.HttpApplication
            {
                protected void Application_Start( )
                {
                    AreaRegistration.RegisterAllAreas( );
                    FilterConfig.RegisterGlobalFilters( GlobalFilters.Filters );
                    RouteConfig.RegisterRoutes( RouteTable.Routes );
                    BundleConfig.RegisterBundles( BundleTable.Bundles );
                }
            }
        }
    

提交回复
热议问题