Copied to clipboard

Flag this post as spam?

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


  • Javier Barrera 34 posts 85 karma points
    Sep 09, 2010 @ 00:32
    Javier Barrera
    0

    umbracoAppTree Requires pre-compiled treeHandlerAssembly. Can we use app_code?

    I know it may not be the best practice, however we'd like to use the /app_code/ directory to create our extension classes. The umbracoAppTree requires a reference to an assembly.

    Is there a way to use this? I've tried setting the treeHandlerAssembly to '__code' as well as the namespace of our extension classes to no avail. Of course, if I take that code and compile it into an assembly and drop it into the /bin/ folder it works just fine.

    The reason that I'd like to do this is because we have a team working on a network share with our development environment. Sometimes we all need to modify a particular class and its a pain transferring the source to each developer each time they need it. Subversion would be an option, but before we explore that I'd like to know if:

    A. Can the above be done using the /app_code/ folder?

    B. How are other development teams handleing this.

    Thanks in advance to anyone.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Sep 09, 2010 @ 00:57
    Aaron Powell
    0

    No, because the way the app trees are loaded it takes the assembly name and appends the type name to it, so if you had MyProject.MyNamespace.MyTree as the tree class in the assembly MyProject you need to set the class to MyNamespace.MyTree in the database table.

    Because App_Code does a compile on application start up you wont know what the name of the assembly is since I"m pretty sure it's uniquely named when it compiles.

    That said I know it is possibly to manipulate the collection of known trees at runtime so you could in create an Umbraco action handler class (inheriting ApplicationBase) which then dynamically injects your tree into the in-memory tree collection.
    If you want to do that I think you're going to be on your own, I know it's possible but it's not exactly supported :P

  • Shannon Deminick 1526 posts 5272 karma points MVP 3x
    Sep 09, 2010 @ 01:05
    Shannon Deminick
    2

    you can dynamically register trees without writing to the database. See this post:

    http://www.shazwazza.com/post/Dynamically-registering-custom-trees-without-writing-to-UmbracoAppTree.aspx

    HOWEVER, be aware that if you do this there's no way for an end user to un-register your tree unless they remove your code/DLL

  • Javier Barrera 34 posts 85 karma points
    Sep 09, 2010 @ 01:54
    Javier Barrera
    0

    Thank you both! From @Shannon's blog, it looks as if I can do what I need to do, but I think I'll stick to the tried and true manner for usability. @slace, thanks again for your quick response. It looks as if we'll need to get serious about programming and impliment subversion for our extensions.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Sep 09, 2010 @ 01:56
    Aaron Powell
    0

    Err yeah, I wouldn't go coding directly in the Umbraco back end with no version control :P

Please Sign in or register to post replies

Write your reply to:

Draft