Extension settings randomly get lost?

Topics: ASP.NET 2.0, Business Logic Layer, Controls
Feb 11, 2008 at 2:07 PM
Hi, I wondered if anybody had come across this issue.

I'm using several extensions on my blog, and many of these have configuration settings which I have set. Today when I viewed my blog, I noticed that these had all reverted to their initial settings.

Has anybody else noticed this?

Paul.
Coordinator
Feb 11, 2008 at 4:32 PM
All extensions lost configuration or some of them? To reset all extension settings, you would need to delete extensions.xml file or data in the beextensionsettings table if you are using database - then it would use defaults... If some extension doing it - it might be setting defaults on every application load instead of doing it ones.
Feb 11, 2008 at 8:14 PM
I had the same problem. If you are using the extensions.xml then there will be two issues that you are going to run into:

1) When the extension manager writes to the extension.xml file then it catches any kind of exception and continues without complaining.
2) If you have a bad behaving extension like the thumbnailer that is going to currupt the extension.xml, then the exception handler in SaveXML() (Manager.cs) is loading the default extension settings and your settings seem to be lost.
BE should not blindly catch any exception in case somebody screws with the extensions.xml file.

Klaus
Coordinator
Feb 11, 2008 at 8:46 PM
Klaus, point taken. I'll make it to throw an error to prevent both problems. Thanks for detailed comment, appreciate it.
Developer
Feb 12, 2008 at 12:44 PM
rtur,
I'm also seeing that any time I edit an extension file (in \App_Code\Extensions\), then all the extension data gets reset. Even if I just add a return character and resave the file, everything is reset. Should this be happening?
Coordinator
Feb 12, 2008 at 1:35 PM

johndyer wrote:
rtur,
I'm also seeing that any time I edit an extension file (in \App_Code\Extensions\), then all the extension data gets reset. Even if I just add a return character and resave the file, everything is reset. Should this be happening?

This is the same problem described by Klaus. This file is generated by serializing object to XML, if you edit it by hand and it becomes unreadable - app will run into error and use defaults overriding corrupted file. It should throw an error and let you go back and fix file (or manually delete it - then it should create new one with default values). I'll submit this fix to source control later today or tomorrow.
Feb 18, 2008 at 4:12 AM
Was there a fix posted for this? I've written my own extension (basically just copying 'format' of others (closest example is GoogleAnalytics extension) and my settings are lost 'every' time I restart Visual Studio debugging.

Any suggestions on how to resolve this?
Coordinator
Feb 18, 2008 at 5:56 PM

terryaney wrote:
Was there a fix posted for this? I've written my own extension (basically just copying 'format' of others (closest example is GoogleAnalytics extension) and my settings are lost 'every' time I restart Visual Studio debugging.

It was posted about a week ago. New build is throwing an error instead of overriding extensions.xml.
Feb 18, 2008 at 9:15 PM
Actually I found a problem (I may or may not have latest build). I had a 'namespace' containing my Extension. (Because I'm gonna have a few files). And the Extension Manager just used the class name isntead of the namespace/class name as a key in its collection. I got rid of the namespace and now it seems to be behaving.