Hi everyone, I am nearly finished with the code for my section, one issue cropped up though, if you remove the package it does not remove the section from the applications.config file. Is there a command or c# override/function I can put into the package.xml file that will tell it to actually remove it on uninstall?
cheers, will try that.
in the Undo part of the code should that have //add? I would have thought a remove or something would be required.
so ie: if my alias of the section is CHEESE would I have ...SelectSingleNode("//add[@alias='CHEESE']");
or would it be ...SelectSingleNode("@alias='CHEESE'");?
Remove a section package correctly
Hi everyone, I am nearly finished with the code for my section, one issue cropped up though, if you remove the package it does not remove the section from the applications.config file. Is there a command or c# override/function I can put into the package.xml file that will tell it to actually remove it on uninstall?
You need create a class that inherits IPackageAction. I made a simple sample code that might help.
References http://endzonesoftware.com/umbraco-install-package-action-adds-new-tab-dashboard-not-section-2/
https://24days.in/umbraco-cms/2013/v7-packages/
Add in package.xml
<Action runat="install" undo="true" alias="YourSection" /
>cheers, will try that. in the Undo part of the code should that have //add? I would have thought a remove or something would be required.
so ie: if my alias of the section is CHEESE would I have
...SelectSingleNode("//add[@alias='CHEESE']");
or would it be...SelectSingleNode("@alias='CHEESE'");
?is working on a reply...