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:
Is the the assembly name required to be dot-less?
Is the assembly name required to be the first-level namespace as well?
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.
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.
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:
Cheers,
André
Oh, talking about v4.0.4.2 here, if thi smatters (I don't think so, but hey...).
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
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.
Got it, thanks for the quick reply. That means, that dots in th eassembly are no problem, which I like ;)
is working on a reply...
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.