Copied to clipboard

Flag this post as spam?

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


  • Mark Evans 86 posts 116 karma points
    Oct 30, 2014 @ 12:18
    Mark Evans
    0

    ContentService v6

    im trying out the contentservice in order to copy content from one site to another.

    however im hitting an issue with just the barebones setup to retriece data.

    added the Umbraco.core.dll, added the references to Umbraco.Core, Umbraco.Core.Models and Umbraco.Services and my page has nothing more complex than...

    int rootID = 1252;
    var cs = ApplicationContext.Current.Services.ContentService.GetChildren(rootID);

    However on running the page doesnt load, and on running debug i get the error:

    Object reference not set to an instance of an object.

     

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Oct 31, 2014 @ 10:27
    Ismail Mayat
    0

    Mark,

    Is this code in website project or console application?  I would take a look at https://github.com/sitereactor/umbraco-console-example on how to use the api to create contnet.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft