Files
ILSpy/ILSpy.AddIn.VS2022
Siegfried Pammer ffb39611b8 Reimplement cross-platform single-instance handling
The Avalonia port dropped ILSpy's single-instance feature, leaving three
inert surfaces behind: the --newinstance / --noactivate switches, and the
"Allow multiple instances" option were parsed and persisted but never read,
and every launch started a new process.

The former WPF implementation also encoded the executable location in the
mutex name, so two ILSpy builds at different paths never shared an instance.
That broke the Windows "Open with ILSpy" shell command: it launches a fixed
executable and would not reuse a running instance started from elsewhere.

Reimplement it with portable primitives (named Mutex + named pipes, no
P/Invoke): the first launch for a user takes the mutex and listens; a later
launch forwards its arguments over the pipe and exits. The namespace is
derived from machine + user only -- never the location -- so any launcher
reuses the running instance. --instanceid is a runtime reuse filter matched
against the running instance's actual executable identity (via
Environment.ProcessPath, single-file-bundle safe), not part of the mutex
name, so it never re-introduces the location partitioning it replaces. The
VS add-in passes its bundled exe path as --instanceid to prefer its own
build while still sharing with a plain launch of that same executable.

Assisted-by: Claude:claude-opus-4-8:Claude Code
2026-07-23 17:02:32 +02:00
..
2026-04-11 12:57:53 +02:00

Test cases for various types of projects as well as corresponding test plans are located in a separate repository.

https://github.com/icsharpcode/ILSpy-Addin-tests