Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Raymond Alavo 2 posts 83 karma points
    Mar 20, 2019 @ 19:27
    Raymond Alavo

    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,

  • Marc Goodson 1775 posts 11810 karma points MVP 7x c-trib
    Mar 20, 2019 @ 23:54
    Marc Goodson

    Hi Raymond

    In V8 a Component would be synonymous with OnApplicationStarted() -

    There is an example here in the docs of registering a custom route with a Component:

    I'm wondering if you could use the same approach with the BundleConfig in the Initialize() method.



  • Raymond Alavo 2 posts 83 karma points
    Mar 21, 2019 @ 13:47
    Raymond Alavo

    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

  • Christoffer Frede 22 posts 112 karma points
    Sep 16, 2020 @ 13:10
    Christoffer Frede

    Hi Raymond. i would to also use the bundleconfig in an Umbraco installation. could you elaborate on what you implemented to create the bundles ?

Please Sign in or register to post replies

Write your reply to: