Skip to content

Remember last Start Debugging dialog options across restarts (#487) - #524

Open
larsborn wants to merge 1 commit into
dnSpyEx:masterfrom
larsborn:remember-start-debugging-options
Open

larsborn wants to merge 1 commit into
dnSpyEx:masterfrom
larsborn:remember-start-debugging-options

Conversation

@larsborn

@larsborn larsborn commented Aug 8, 2026

Copy link
Copy Markdown

Fixes #487

The Debug Program dialog setting where only in memory, so the executable, arguments, working directory etc. were lost on restart. This was quite annoying for me in the past. This PR persists the last-used options to the settings file and restores them the next time the dialog is opened.

The serialize helpers are intentionally implemented per engine (CorDebug / Mono / Mono-connect) even though they look similar: the options hierarchies only share BreakKind, and the engine contract assemblies don't reference each other. A shared helper would have required new cross-engine public API, so I followed the existing structure of the page base classes instead. Happy to change that if you want.

Tested under Windows with net48.

…#487)

The Debug Program dialog kept its MRU only in memory, so the executable, arguments, working directory etc. were lost when dnSpy was restarted.

The last used options are now saved to the settings file and restored the next time the dialog is opened. Since StartDebuggingOptions is polymorphic and the concrete types live in per-engine contract assemblies, serialization is implemented via two new virtual methods on StartDebuggingOptionsPage (SerializeOptions/DeserializeOptions) that each engine's page overrides. Pages that don't override them simply aren't persisted.

Environment variables are intentionally not persisted: DbgEnvironment pre-loads the entire current process environment, so serializing it would bloat the settings file and replay a stale environment.
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

Successfully merging this pull request may close these issues.

Debug remembering arguments

1 participant