Run code when application starts using global.asax
Hello all,
I am trying to run the BundleConfig.cs when my application starts. In the previous version of Umbraco (v7.13), I was able to achieve it by overriding the OnApplicationStarted() method from the UmbracoApplication Class, in a custom Global.asax.
I am trying to reproduce that with Umbraco v8, but the OnApplicationStarted() method doesn't seems to be accessible.
I went through the documentation in order to find any alternative, I found this article but I am wondering if it is relevant to what I am doing because I had some issue to apply that to my case.
Run code when application starts using global.asax
Hello all,
I am trying to run the BundleConfig.cs when my application starts. In the previous version of Umbraco (v7.13), I was able to achieve it by overriding the OnApplicationStarted() method from the UmbracoApplication Class, in a custom Global.asax.
I am trying to reproduce that with Umbraco v8, but the OnApplicationStarted() method doesn't seems to be accessible.
I went through the documentation in order to find any alternative, I found this article but I am wondering if it is relevant to what I am doing because I had some issue to apply that to my case.
thanks for your help in advance,
Hi Raymond
In V8 a Component would be synonymous with OnApplicationStarted() - https://www.zpqrtbnk.net/posts/composing-umbraco-v8-components/
There is an example here in the docs of registering a custom route with a Component:
https://our.umbraco.com/documentation/Reference/Routing/custom-routes
I'm wondering if you could use the same approach with the BundleConfig in the Initialize() method.
regards
Marc
Hi Mark, Thanks for the links. I was able to create a component and use the Initialize() method to execute the BundleConfig.
Best regards, Ray
Hi Raymond. i would to also use the bundleconfig in an Umbraco installation. could you elaborate on what you implemented to create the bundles ?
is working on a reply...