Copied to clipboard

Flag this post as spam?

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


  • Thomas 157 posts 332 karma points
    Dec 16, 2020 @ 08:03
    Thomas
    0

    ContentService Published Event I am Getting the IPublishedContent but the properties returns null

    Hi there, i am facing a very strange issue and i cannot figure out a solution. On ContentService_Published event i am trying to get the Url of the published content. So i am calling the

    contentHelper.GetById(node.Id)

    to get the published content and retrieve the Url value. The strange thing is that with debugging and Quick Watch in the object i can see the values. In the code as soon as i am trying to get a value of a property i am getting null reference excrption. I open again the Quick Watch and the property value exists. See the attached pictures.

    Any suggestions? Null Reference in Code

    Values exists in Quick Watch

  • Thomas 157 posts 332 karma points
    Dec 16, 2020 @ 08:34
    Thomas
    0

    The problem finally is with the async method and the Task Factory. When i remove that part of code everything works fine. So, how can i call an async method within the ContentService Published method?

  • leancodemanish 2 posts 22 karma points
    May 12, 2021 @ 12:11
    leancodemanish
    0

    Hi, how did you attach ContentService_Published method to the event?

  • Andrew Meares 1 post 20 karma points
    May 12, 2021 @ 12:41
    Andrew Meares
    0

    Publish with Descendants does not trigger ContentService.Published event

    Check out below link, it will helpful https://github.com/umbraco/Umbraco-CMS/issues/9167

Please Sign in or register to post replies

Write your reply to:

Draft