Force reload of the handler assembly in a custom section
Hi all,
I am struggling with the following some time now and I do not seem to get it to work.
I have a custom "managing" section for Umbraco 4.5.2 which is actually capable of creating other custom sections at runtime. Every new section is assigned to a generic TreeLoader class (derived from BaseTree) located in the same assembly DLL. This handler will eventually get assigned to any given number of sections but because the content is database driven, I am able to distinguish between sections by using the appAlias.
So far so good, everything gets loaded as expected and you can see the new sections get created in the back office (you do have to refresh the page though to see it) except one small detail. Only the root item of any new custom section will appear. The expected nodes beneath the root item, created in the Render() method never show.
At least not until I force .NET to reload Umbraco by touching the web.config. This is working again as expected until I create yet another new section which will bring us back to square 1. I have traced the problem down to the Render() method not being called for a DLL already assigned as a handler for another custom section.
The big question is: Am I seriously missing something here or is this by design? And if so is there a way to force a full reload of the handler assembly after the section is created, without having to first reload the entire Umbraco?
I already looked at things like location.reload, parentReload, ClientTools.RefreshTree etc etc but all this have an effect only on the Content tree I guess. I've even created separate assembly DLLs, compiling them at runtime but even that didn't work. Copying a DLL in the /bin folder of Umbraco while logged in the back office can get messy, as I discovered first hand !!!.
I am sorry about the length of the topic but any of your thoughts would be much appreciated.
Force reload of the handler assembly in a custom section
Hi all,
I am struggling with the following some time now and I do not seem to get it to work.
I have a custom "managing" section for Umbraco 4.5.2 which is actually capable of creating other custom sections at runtime. Every new section is assigned to a generic TreeLoader class (derived from BaseTree) located in the same assembly DLL. This handler will eventually get assigned to any given number of sections but because the content is database driven, I am able to distinguish between sections by using the appAlias.
So far so good, everything gets loaded as expected and you can see the new sections get created in the back office (you do have to refresh the page though to see it) except one small detail. Only the root item of any new custom section will appear. The expected nodes beneath the root item, created in the Render() method never show.
At least not until I force .NET to reload Umbraco by touching the web.config. This is working again as expected until I create yet another new section which will bring us back to square 1. I have traced the problem down to the Render() method not being called for a DLL already assigned as a handler for another custom section.
The big question is: Am I seriously missing something here or is this by design? And if so is there a way to force a full reload of the handler assembly after the section is created, without having to first reload the entire Umbraco?
I already looked at things like location.reload, parentReload, ClientTools.RefreshTree etc etc but all this have an effect only on the Content tree I guess. I've even created separate assembly DLLs, compiling them at runtime but even that didn't work. Copying a DLL in the /bin folder of Umbraco while logged in the back office can get messy, as I discovered first hand !!!.
I am sorry about the length of the topic but any of your thoughts would be much appreciated.
Regards,
Manos
is working on a reply...