混合Web表单和MVC - Application_Start不会触发

时间:2016-11-02 18:34:19

标签: .net asp.net-mvc

我是用户VS2015。我有一个Web表单(aspx)应用程序。前段时间,我决定将MVC控制器包含在应用程序(和捆绑)中。我已将下面的代码添加到global.asax:

    public class Global : HttpApplication
  {
    void Application_Start(object sender, EventArgs e)
    {
      // Code that runs on application startup
      AreaRegistration.RegisterAllAreas();
      RouteConfig.RegisterRoutes(RouteTable.Routes);
      BundleConfig.RegisterBundles(BundleTable.Bundles);
    }

里面的代码根本不会发射。它被添加到global.asax.cs,就像在常规MVC项目中一样。如何强制运行此代码?

0 个答案:

没有答案