Copied to clipboard

Flag this post as spam?

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


  • Thomas 151 posts 326 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 151 posts 326 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?

  • 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