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
    1 week ago
    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

Please Sign in or register to post replies

Write your reply to:

Draft