IConfigurablePlugin.Settings setter not being called

Sep 10, 2007 at 11:10 AM
Edited Sep 10, 2007 at 6:07 PM
I have written a Cropper plug-in to publish an image and an article to WordPress blogs, but ran into some problems during saving/loading of options:

For some reason, the setter method for the IConfigurablePlugin.Settings impemented property is not being called when my plug-in is loaded.. I see the getter method being called several times when I start up Cropper and twice when I close Cropper, but upon starting, the setter is not called. This effectively makes my settings not being loaded...

I've checked that I'm not returning null for the getter either ... and the On-Settings-Changed (forget the name now) event IS being triggered also...

Any ideas..?

Edit:
See my comment here: http://www.codeplex.com/cropperplugins/Wiki/View.aspx?title=IConfigurablePlugin.Settings
Developer
Jun 22, 2009 at 5:24 PM

I'm just getting started with the internals of Cropper so I hope I can help without sounding like an idiot.

Your plugin option settings aren't saved until you actually open Opens, change data, then OK the change. At that time, pluginSettings is populated your PluginSettings object, and the data is serialized. Once this data has been saved, from then forward the data is read from the .config file, and your setter is also called.

So my question to you (almost two years after you posted this note) would be whether you changed your data to save it before expecting the setter to be invoked?  I know that's sort of a "duh" question but someone might think that just having an addin and setting defaults for Options might cause the setter to be invoked.

Also, as of this date, the v1.9.x code that I'm looking at uses a textwriter for formatting, it's not binary formatter.

One thing I did notice is that in the Configuration.SaveConfiguration method errors in serialization are ignored. I'll fix that along with a number of other changes I've been making.

HTH