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
    0

    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 1247 posts 8423 karma points MVP 5x c-trib
    Mar 20, 2019 @ 23:54
    Marc Goodson
    100

    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

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

    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 3 posts 73 karma points
    1 week ago
    Christoffer Frede
    0

    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:

Draft