Copied to clipboard

Flag this post as spam?

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

  • Hicham el Allouchi 1 post 71 karma points
    Oct 25, 2018 @ 13:24
    Hicham el Allouchi

    Get the all the id of root contents

    Hello Our Umbraco community!

    I am trying to make an Umbraco package. for that package I need all the ids, nodenames, cultures and domainnames of the root contents.

    I tried the following

    var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current);
    var allContents = umbracoHelper.TypedContentAtRoot();

    This however gives me the following exeption in the logs:

    System.ArgumentNullException: Value cannot be null.
    Parameter name: httpContext
    at System.Web.HttpContextWrapper..ctor(HttpContext httpContext)
    at h5ysr_package.DataCollectorSender.GetlinkedDomains()
    at h5ysr_package.DataCollectorSender.  <StartCollection>d__2.MoveNext()

    How would I solve this problem?

  • Alex Skrypnyk 6083 posts 23481 karma points MVP 6x admin c-trib
    Oct 29, 2018 @ 20:58
    Alex Skrypnyk

    Hi Hicham

    Where did you place this code? Is it a controller or so?

    Did you add needed namespaces?


Please Sign in or register to post replies

Write your reply to: