Copied to clipboard

Flag this post as spam?

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


  • Filipe Sousa 43 posts 205 karma points
    Nov 12, 2019 @ 14:11
    Filipe Sousa
    0

    Cached page url

    Hi everyone! In Umbraco V8 I can get the url for a page in the cache during the Saving event but not on the Published event (these are the events triggered when saving & publishing this same page I'm trying to fetch the url for). I'm using the UmbracoContextFactory.

    It throws an page.Url = 'page.Url' threw an exception of type 'System.InvalidOperationException'.

    Is this a bug? (edited)

  • Filipe Sousa 43 posts 205 karma points
    Nov 12, 2019 @ 15:08
    Filipe Sousa
    0

    So I found out what it was. I was accessing the cache inside the call to using (var contextReference = _contextFactory.EnsureUmbracoContext()) { but in another thread. So what I had to do was to call the previous code inside the thread as well.

  • 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