【问题标题】:Shouldn't OwinStartupAttribute run before global.asax and Application_Start?OwinStartupAttribute 不应该在 global.asax 和 Application_Start 之前运行吗?
【发布时间】:2014-09-19 20:24:27
【问题描述】:

我需要在应用程序启动之前运行代码,直到现在我已经使用 WebActivator 来执行此操作,但如果我理解正确,OwinStartupAttribute 更适合于此,但对我来说问题是它在Application_Start 之后运行Global.asax,这是正确的还是我可以将其配置为运行预应用程序启动?

【问题讨论】:

    标签: c# asp.net-mvc asp.net-mvc-5 owin


    【解决方案1】:

    根据这个答案,它在 Application_Start 之后稍微运行。因此,如果您像我一样需要在 Application_Start 之前运行代码,我想 WebActivator 仍然是要走的路。 Do I need a Global.asax.cs file at all if I'm using an OWIN Startup.cs class and move all configuration there?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-03
      • 2014-11-10
      • 1970-01-01
      • 1970-01-01
      • 2011-02-22
      • 1970-01-01
      相关资源
      最近更新 更多