Try our conversational search powered by Generative AI!

EpiServer.Global Application_Start isn't fired up



I've faced with the issue, that the Application_Start event in Global.asax isn't getting fired up, unless the Globlal is inherited from HttpApplication directly. Why it might happen? I tried to remove Global.asax and add a new one it's not helped. Could someone advice please?

Sep 18, 2015 13:21

I'm using EpiServer verstion.

Sep 18, 2015 14:29

THis might not help you directly, but:

If you want to run code at site startup, you should use IInitializableModule or IConfigurableModule along with the InitializableModule attribute, this will ensure that EPiServer is done starting up before you run code, and will probably save you a lot of headache in the long run:

	[ModuleDependency(typeof(ServiceContainerInitialization), typeof(EPiServer.Web.InitializationModule))]
	public class Initializer : IConfigurableModule

You only need to add the attribute and interface implementations, EPiServer will scan all assemblies for this attribute and execute them in ModuleDependency order.

Sep 18, 2015 16:11

Your Global.asax.cs should look something like this:

public class EPiServerApplication : EPiServer.Global
        protected void Application_Start()
            //Tip: Want to call the EPiServer API on startup? Add an initialization module instead (Add -> New Item.. -> EPiServer -> Initialization Module)

You need to inherit from EPiServer.Global

Sep 18, 2015 22:10
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.