I've created a custom package with various components. Among them is a new icon in the app tray (a.k.a. sections area). After installing the package, I can navigate to the new section but I cannot see the tree nodes until I force an app reload by manually altering the web.config. Typically I just add a line blank line to web.config and save it. I was hoping to find a way to automate this when my package gets installed.
I'm still working on this. I thought I found a solution but it caused another issue. I tried having a controller that gets called after install add a key to the web.config. Something like this:
if (!IsPostBack)
{
Log.Add(LogTypes.Debug, -1, "Adding web.config app setting identifying installation of our package.");
Configuration c = WebConfigurationManager.OpenWebConfiguration("~");
AppSettingsSection appSettings = c.AppSettings;
appSettings.Settings.Add("MyPackage", "true");
c.Save(ConfigurationSaveMode.Full);
}
This works to trigger an app reload but it causes my package uninstall actions to be ignored. I have a custom uninstall action that removes database entries specific to my package. If I use the web.config update code, the database code never gets called (on uninstall). If I don't update the web.config, it gets called. I guess reloading the web.config interrupts the package install process before it has had a chance to log the uninstall actions. So still stuck but making some progress. Hope to post the solution here eventually. :-)
Hmm, turns out that any edit to web.config whether during package install or at any random time thereafter nulls my custom uninstall action. I suspect this is a bug in the package installer. I'm going to put together a simple test package to reproduce the behavior and submit it.
Trigger App Reload on Package Install
I've created a custom package with various components. Among them is a new icon in the app tray (a.k.a. sections area). After installing the package, I can navigate to the new section but I cannot see the tree nodes until I force an app reload by manually altering the web.config. Typically I just add a line blank line to web.config and save it. I was hoping to find a way to automate this when my package gets installed.
Thanks,
Rick
I'm still working on this. I thought I found a solution but it caused another issue. I tried having a controller that gets called after install add a key to the web.config. Something like this:
This works to trigger an app reload but it causes my package uninstall actions to be ignored. I have a custom uninstall action that removes database entries specific to my package. If I use the web.config update code, the database code never gets called (on uninstall). If I don't update the web.config, it gets called. I guess reloading the web.config interrupts the package install process before it has had a chance to log the uninstall actions. So still stuck but making some progress. Hope to post the solution here eventually. :-)
Hmm, turns out that any edit to web.config whether during package install or at any random time thereafter nulls my custom uninstall action. I suspect this is a bug in the package installer. I'm going to put together a simple test package to reproduce the behavior and submit it.
I submitted a bug based on what I have found http://bit.ly/bCKrt1 ;
Always report bugs on Codeplex, this forum category is for forum bugs only (ie, the umbraco code this forum is running on)
Anyway, thanks for all the work and feedback.
Cheers,
/Dirk
Good to know, thanks! I have added it to Codeplex http://umbraco.codeplex.com/workitem/28945 and will use Codeplex from now on for bugs.
is working on a reply...