Copied to clipboard

Flag this post as spam?

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


  • atze187 160 posts 215 karma points
    Jun 17, 2010 @ 11:36
    atze187
    0

    Custom tree: assembly and namespace naming requirements

    Hi,

    last night I faced the following problem when refactoring existing custom trees. My assembly and namespace naming matched mtUmbraco.Trees.CustomTree, the treehandler type matched loadCustomTree, so the fully qualified name was mtUmbraco.Trees.CustomTree.loadCustomTree. For treeHandlerAssembly column in umbracoAppTree table I used "mtUmbraco.Trees.CustomTree", for treeHandlerType I used "mtUmbraco.Trees.CustomTree". The tree did not load. Since I was tired, I decided to try again today - no luck. After having a look at the data in the umbracoAppTree table, I realized that the assembly name never contains a dot (we used to do this using the umbraco source and we did put our trees to the trees folder in umbraco.cms.presentation and compiled our own umbraco from that sources, which isn't good practice, that's why we decided to refactor).

    I had luck, when i changed the assembly name to a single term without any dots in it (CustomTree.dll) and ensured that I don't have any nested namespace, so the umbracoAppTree table contains "CustomTree" as treeHandlerAssembly and "loadCustomTree" as treeHandlerType.

    Just to know what caused this problem:

    1. Is the the assembly name required to be dot-less?
    2. Is the assembly name required to be the first-level namespace as well?
    3. Why not using a fully qualified type name?

    Cheers,
    André

  • atze187 160 posts 215 karma points
    Jun 17, 2010 @ 11:37
    atze187
    0

    Oh, talking about v4.0.4.2 here, if thi smatters (I don't think so, but hey...).

  • Matt Brailsford 2958 posts 15629 karma points MVP 7x c-trib
    Jun 17, 2010 @ 12:01
    Matt Brailsford
    1

    Hi Andre,

    I believe the treeHandlerAssembly column is combined with the treeHandlerType column to actualy work out the fully qualified namespace.

    So say you have an assembly My.Assembly and you have your custom loader at My.Assembly.Loaders.MyLoader in the treeHandlerAssembly  column you would put My.Assembly and in the treeHandlerType column you would put Loader.MyLoader.

    Matt

  • Tim 1193 posts 2655 karma points c-trib
    Jun 17, 2010 @ 12:09
    Tim
    0

    I had a similar problem with getting a custom content tree to be picked up. In the end I found that I needed my assembly name to exactly match the namespace for the tree class in order for it to work.

    So my assembly was called "My.Assembly", the root namespace was the same, and then my tree was called loadMyTree. That seemed to make it work for me. If the namespace wasn't the same, it didn't load the tree.

  • atze187 160 posts 215 karma points
    Jun 17, 2010 @ 12:24
    atze187
    0

    Got it, thanks for the quick reply. That means, that dots in th eassembly are no problem, which I like ;)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies