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
    0

    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 5772 posts 21985 karma points MVP 4x admin c-trib
    Oct 29, 2018 @ 20:58
    Alex Skrypnyk
    0

    Hi Hicham

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

    Did you add needed namespaces?

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft