Application_Start does not start in ASP.NET MVC application

I have an ASP.NET MVC application where an event Application_Start

doesn't seem to fire. The symptoms are that the log statement NLog

in this handler does not generate a log entry and none of my routes are populating (which is why all my controller action requests are returning 404).

Static files on the server (like favicon.ico) are served correctly.

I have log statements in Application_BeginRequest

and Application_EndRequest.

. These entries generate log entries for both controller methods and static files, so I'm pretty sure the application pool is configured correctly.

The problem occurs on our staging server, but not on my local machine or our dev server.

Any idea what might be causing this?

+3


source to share


1 answer


It turned out to be a combination of things. The root cause was conflicting DLL versions, and I figured that by configuring the project to copy the assemblies the problem was in the bin folder. Also, there was some code in Application_Error that prevented the actual exception from being displayed.



0


source







All Articles