HI All,
I need to register my JavaScript bundles in ApplicationStart event of my Umbraco application , but the Applicationstart is not being hit . i have updated my Global.asax as follows
thanks for suggestion guys , but its kind of weird behavior , break point at the Application Starting is not being hit every time i start debugging the application
Hi Yasir,
I Have placed my register bundle code inside ApplicationStarted method of a class inherited from ApplicationEventHandler , and seems like everything works fine , but earlier i was doing the register bundle or register autofac dependencies in Application_start method of global.asax which is not being hit now. just want to know how this works here cant we use global.asax and ApplicationEventHandler at the same time?
Application_Start is not being hit
HI All, I need to register my JavaScript bundles in ApplicationStart event of my Umbraco application , but the Applicationstart is not being hit . i have updated my Global.asax as follows
<%@ Application Codebehind="Global.asax.cs" Inherits="MyProject.Web.MvcApplication" Language="C#" %>
Any suggestions what i am doing wrong?
Yogesh
https://our.umbraco.org/documentation/Reference/Events/application-startup
Should help?
Hi Yogesh, no need to change Global.asax in this case, just create class inherited from ApplicationEventHandler like in the article suggested by Mike
thanks for suggestion guys , but its kind of weird behavior , break point at the Application Starting is not being hit every time i start debugging the application
Yogesh
Hi
this will only hit once when application start first time if you refresh the browser so it will not hit again.
Yasir
Hi Yasir, I Have placed my register bundle code inside ApplicationStarted method of a class inherited from ApplicationEventHandler , and seems like everything works fine , but earlier i was doing the register bundle or register autofac dependencies in Application_start method of global.asax which is not being hit now. just want to know how this works here cant we use global.asax and ApplicationEventHandler at the same time?
Yogesh
Hi,
Please have a look here
https://our.umbraco.org/forum/developers/extending-umbraco/52630-Umbraco-7-Globalasax-
this way you can run your code in Global.asax.cs file
Yasir
Have you also seen...
https://our.umbraco.org/projects/developer-tools/optimus/
is working on a reply...