在IIS中未调用Application_Start [英] Application_Start is not being called in IIS
问题描述
我有一个WCF服务,我最近添加了一个Global.asax。
I have a WCF service that I recently added a Global.asax to.
当我在Visual Studio中运行它工作正常,但我把它放在我的品牌上新的Windows Server 2012 R2服务器和 Application_Start()
未被调用。
When I run in Visual Studio it works fine, but I put it on my brand new Windows Server 2012 R2 server and Application_Start()
is not called.
我确定它未被调用,因为我添加了:
I am sure it is not called because I added:
throw new ApplicationException("The End is .... HERE!");
在方法开头。当从visual studio运行时,它会按预期启动,但是当从IIS运行时它不会被抛出。
at the start of the method. It throws on start up as expected when run from visual studio, but when run from IIS it is not thrown.
我看到了这个问题: Application_Start未在IIS中触发
但设置为Classic没有工作...
I saw this question: Application_Start is not firing in IIS
But setting to "Classic" did not work...
如何在启动时让IIS调用我的 Application_Start()
? / strong>
How can I get IIS to call my Application_Start()
on startup?
推荐答案
在服务器上部署 global.asax
文件。
这篇关于在IIS中未调用Application_Start的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!