Copied to clipboard

Flag this post as spam?

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


  • ruben 8 posts 28 karma points
    Apr 21, 2010 @ 15:40
    ruben
    0

    adding a new document/content node via API

    hi,

    I'm totally new to umbraco and recently started programming again (so I could have made mistakes on both fields).

    I'm trying to add new content with c# as descibed in the API cheatcheat (http://our.umbraco.org/wiki/reference/api-cheatsheet/creating-a-document)

    steps i took:

    - added cms,businesslogic and umbraco dll's to my project

    - added refences to those dll's.

    - added the usings and the code 

    - and then I get the following error when I try to debug:

    Could not load file or assembly 'umbraco.DataLayer, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

    so i added the umbraco.datalayer.dll and added a reference to it.

    when i run again i get this error on the line that defines the user:

    The type initializer for 'umbraco.BusinessLogic.Application' threw an exception.

     

    so in short does anyone have some more information on how to do this??

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Apr 21, 2010 @ 16:32
    Thomas Höhler
    0

    Take a look intot the code of my Codegarden 09 Session. In Sample 1 I added some nodes programattically...

    hth, Thomas

  • ruben 8 posts 28 karma points
    Apr 26, 2010 @ 10:39
    ruben
    0

    hi thomas, 

    I googled and found some info about that session, but I haven't found the code anywhere. Could you please be so kind as to provide a link for me.

     

    thanks a million!

    Ruben

  • Tobias Neugebauer 52 posts 93 karma points
    Apr 26, 2010 @ 10:50
    Tobias Neugebauer
    0

    Hi there!

    How are your trying to acomplish this? Is this a Programm outside of umbraco and IIS (seems to be the case!)? Then your should do it via WebServices (look into umbraco/webservices/)! If this is e.g. an ActionHandler you could try to put your code in the App_Code Folder of the Web-Project where you would have no problems about referencing dll's and try it again. If everything works okay from there you know that you ar missing some references.

    Maybe you could try to explain what you would like to do...

    Toby

     

  • Thomas Höhler 1237 posts 1709 karma points MVP
    Apr 26, 2010 @ 10:58
    Thomas Höhler
    0

    Sorry, missed the link: http://our.umbraco.org/wiki/codegarden-2009/codegarden09-sessions/the-box/using-webservices-in-umbraco

    Code can be found on my blog: http://blog.thoehler.com/2009/07/23/summary-of-my-cg09-session

    And as Tobias pointed out, take a look at the build in webservices (in 4.0.x not completely implemented, so you have to check if they are ok for you)

    hth, Thomas

     

  • ruben 8 posts 28 karma points
    Apr 26, 2010 @ 11:25
    ruben
    0

    I was trying to accomplish it via a program outside umbraco and iis, but I didn't use a webservice. Stupid mistake.

     

    thanks for the help and the links guys, I'll start over and see if I can get it to work now. ;-)

Please Sign in or register to post replies

Write your reply to:

Draft