Question

I am not familiar with how to make a package and include a controller with the package and was looking at the ELMAH.MVC package and notice that it does this.

I thought I would find a module to it in the web.config file or something that would call the bootstrap class but I can't figure out how this is called.

It looks like Bootstrap.Initialize needs to be called but I can't figure out how this is done.

My question is how is the controller with this package being registered?

EDIT: After working on this for 2 hours I may have found the solution.

Inside the Assembly.cs is an attribute that looks like [assembly: PreApplicationStartMethod(typeof(Elmah.Mvc.Bootstrap), "Initialize")]

From my quick reading this seems to call the method before the Application_start method gets called.

This seems scary, but cool, but scary. It took me a long time to find this and I would have never thought to do something like this.

I believe this answer my question.

Was it helpful?

Solution

Inside the Assembly.cs is an attribute that looks like

[assembly: PreApplicationStartMethod(typeof(Elmah.Mvc.Bootstrap), "Initialize")]

I was unaware of this attribute until I found this. Some information on it can be found at

When does PreApplicationStartMethod actually get triggered to run?

Which PreApplicationStartMethod should I use?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top