gemini icon indicating copy to clipboard operation
gemini copied to clipboard

Do Not Save Application State In Debug Mode

Open ChayimFriedman2 opened this issue 4 years ago • 1 comments

First, thanks for the excellent framework! 🥇

Gemini automatically saves all modules state in ./Application.bin. This is great as this automatically stores the layout and reducing the work you need to do.

However I installed the Inspector module, and configured it to be opened at startup. Lately, I found PropertyGrid is more appropriate in my case, so I replaced the code. But that didn't work! 😢

I debugged the decompiled code of the library (using dnSpy a great tool by the way), and lastly found that the application restored my previous layout which was stored in ./Application.bin, and because the restore succeed, it didn't try to use the code's DefaultTools. The immediate solution was, obviously, to delete it (btw I deleted bin and obj folders entirely).

Because such changes are common in debug mode, and because we don't want to loss the functionality of recovering application's state, I think we need to turn this feature off in debug mode (maybe using conditional compilation).

Thank you again for the great work.

ChayimFriedman2 avatar Apr 22 '20 17:04 ChayimFriedman2

Refer to Gemini.Modules.Shell.ViewModels.ShellViewModel

It has a virtual property called StateFile. You could have your application implement its own IShell that extends from this class and override StateFile so it returns a different file name when running under #if DEBUG

kornman00 avatar Aug 23 '22 19:08 kornman00