【问题标题】:Application_Start is not being called in IISIIS 中未调用 Application_Start
【发布时间】:2016-09-02 20:28:20
【问题描述】:

我有一个 WCF 服务,我最近添加了一个 Global.asax。

当我在 Visual Studio 中运行时,它运行良好,但我将它放在我全新的 Windows Server 2012 R2 服务器上并且没有调用 Application_Start()

我确定它没有被调用,因为我添加了:

throw new ApplicationException("The End is .... HERE!");

在方法的开始处。从 Visual Studio 运行时会按预期启动,但从 IIS 运行时不会抛出。

我看到了这个问题:Application_Start is not firing in IIS
但是设置为“经典”不起作用...

如何让 IIS 在启动时调用我的Application_Start()

【问题讨论】:

  • 您是否也部署了 global.asax 文件?
  • @AdrianIftode 你太棒了!!!!我没有将它复制到服务器。将其发布为答案,我会接受!

标签: asp.net wcf iis


【解决方案1】:

在服务器上也部署global.asax 文件。

【讨论】:

    猜你喜欢
    • 2020-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多