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'.
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.
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)
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.is working on a reply...