Copied to clipboard

Flag this post as spam?

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


  • Mikael Axel Kleinwort 154 posts 499 karma points c-trib
    Dec 09, 2024 @ 10:12
    Mikael Axel Kleinwort
    0

    Reading content once at app start - inside of UmbracoApplicationStartedNotification?

    What I am trying to do is reading a specific content node after Umbraco started, and update application configuration with the obtained data. This needs to happen only once at app start.

    For this, I try to use UmbracoApplicationStartedNotification. However, I am unable to obtain access to IPublishedContent inside of my notification code.

    What I tried is injecting on of

    • IUmbracoContextAccessor
    • IUmbracoHelper
    • IPublishedCache
    • IPublishedContentCache

    but I get exceptions that the service cannot be resolved.

    How can I get access to IPublishedContent inside of UmbracoApplicationStartedNotification, or is there a better approach for my task?

    Kind regards, Mikael

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies