Vaccano Vaccano - 3 months ago 14
ASP.NET (C#) Question

Application_Start is not being called in IIS

I have a WCF service that I recently added a Global.asax to.

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!");


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.

I saw this question: Application_Start is not firing in IIS

But setting to "Classic" did not work...

How can I get IIS to call my
Application_Start()
on startup?

Answer

Deploy on server the global.asax file too.