Copied to clipboard

Flag this post as spam?

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


  • Graeme Paul 44 posts 64 karma points
    Jul 06, 2011 @ 14:23
    Graeme Paul
    0

    'businesslogic' does not exist in namespace 'umbraco.cms'

    hey guys im having a issue with my assembly files and get the error  'businesslogic' does not exist in namespace 'umbraco.cms' when i try to combile the project. I have made sure i have included cms.dll, businesslogic.dll and umbraco.dll in the bin folder.

    Im trying tro replicate what blog4umbraco is doing with the autopopulate postDate. Below is the code, any idea where im going wrong? thanks

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;

    using umbraco;
    using umbraco.BusinessLogic;
    using umbraco.BusinessLogic.console;
    using umbraco.cms.businesslogic.web;

    namespace UmbracoCmsNews
    {
    public class NewsCms : umbraco.BusinessLogic.ApplicationBase
    {

    void Document_New(Document sender, umbraco.cms.businesslogic.NewEventArgs e)
    {

    if (sender.ContentType.Alias == "News_Article_doc")
    {

    if (sender.getProperty("postDate") != null)
    {

    sender.getProperty("postDate").Value = sender.CreateDateTime.Date;

    }

    }

    }
    }
    }
  • Graeme Paul 44 posts 64 karma points
    Jul 11, 2011 @ 11:35
    Graeme Paul
    0

    Has anyone got any ideas?

    thanks

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jul 11, 2011 @ 11:41
    Richard Soeteman
    0

    Hi,

    Make sure you reference all of the following dll's:

    • umbraco.dll
    • businesslogic.dll
    • cms.dll
    • interfaces.dll
    • ClientDependency.Core.dll

    The above mentioned code will not work because you need to wire up the event in the constructor first. Checkout example in a blogpost I wrote to see how that is handled.

    Cheers,

    Richard

     

  • Graeme Paul 44 posts 64 karma points
    Jul 12, 2011 @ 14:53
    Graeme Paul
    0

    Thanks Richard, i added the constructor and it still didnt work. I went through the assembly files and made sure they were referenced and that this worked (cms.dll was not referenced).

    thanks again

    Graeme

Please Sign in or register to post replies

Write your reply to:

Draft