Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do Not Save Application State In Debug Mode #315

Open
ChayimFriedman2 opened this issue Apr 22, 2020 · 1 comment
Open

Do Not Save Application State In Debug Mode #315

ChayimFriedman2 opened this issue Apr 22, 2020 · 1 comment

Comments

@ChayimFriedman2
Copy link

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.

@kornman00
Copy link
Sponsor Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants