Hey all:
You may not come across this problem yourselves, but it's a bit of an issue for me. Any insight you have off the top of your heads would be greatly appreciated.
The problem stems from me wanting to override default settings. Let's use ClearCanvas.Desktop.ToolStripSettings as an example. Say I want WrapLongToolstrips to default to 'True' rather than 'False' for my distribution of CC and my plugins. I figured that if I copied the ToolStripSettings XML into ClearCanvas.Desktop.Executable.exe.config (I've copied both the section and the settings, and left them as 'userSettings') and changed the default value of WrapLongToolstrips to 'True', this would work. It does...sort of.
The default value gets changed successfully; WrapLongToolstrips is 'True'. The problem stems from when I try to change the toolbar settings via Options-->Toolbar. If I change the WrapLongToolstrips settings value in this manner, and then close ClearCanvas, my settings saved in the 'User.config' file that's buried in 'Documents and Settings' (I left the settings caching parameter as 'MachineToLocalUser'). Unfortunately, 'User.config' ends up getting corrupted - the section declaration for ClearCanvas.Desktop.ToolStripSettings is missing. This means that when I try to relaunch ClearCanvas, it tries to load an invalid 'User.config' file, and crashes immediately with a configuration exception. Nothing gets logged though, since the app didn't actually start. You just get the "ClearCanvas encountered a problem and needs to close" message box.
If I delete the 'User.config' file at this point, ClearCanvas will run again. Likewise, if I remove my overridden settings from ClearCanvas.Desktop.Executable.exe.config, everything's fine. I can change and save the Toolbar options without any problems.
Any idea what I'm doing wrong here? Am I even allowed to override default setting values this way, or any other way for that matter?