From 002742c07edac73f47df534973b9bd8f42bc8bdf Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 4 Jun 2026 07:45:40 +0200 Subject: [PATCH] Switch to the Avalonia 12 DevTools (WithDeveloperTools) bridge Avalonia 12 dropped the in-process Avalonia.Diagnostics package (its last release is 11.3.x), so AttachDevTools no longer shows a window. Move to the AvaloniaUI.DiagnosticsSupport bridge driven by WithDeveloperTools() in BuildAvaloniaApp -- it attaches internally, so a separate App-level AttachDeveloperTools call would double-attach and throw. The inspector is the AvaloniaUI.DeveloperTools global tool (avdt) connecting over the bridge. DEBUG-only: the assets are dropped from Release builds. Assisted-by: Claude:claude-opus-4-8:Claude Code --- ILSpy/ILSpy.csproj | 4 ++++ ILSpy/Program.cs | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index 7a5469372..c4b2dc0e9 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -67,6 +67,10 @@ + None All diff --git a/ILSpy/Program.cs b/ILSpy/Program.cs index 53c6e1f6a..47fdbcaa8 100644 --- a/ILSpy/Program.cs +++ b/ILSpy/Program.cs @@ -33,8 +33,17 @@ namespace ILSpy // Avalonia configuration, don't remove; also used by visual designer. public static AppBuilder BuildAvaloniaApp() - => AppBuilder.Configure() - .UsePlatformDetect() - .LogToTrace(); + { + var builder = AppBuilder.Configure() + .UsePlatformDetect(); +#if DEBUG + // Enables and attaches the Avalonia 12 DevTools bridge (it calls AttachDeveloperTools + // internally, so no separate App-level attach is needed -- a second call throws + // "already attached"). The avdt global tool connects over this bridge. Gated on DEBUG + // because the DiagnosticsSupport assets are excluded from Release. + builder = builder.WithDeveloperTools(); +#endif + return builder.LogToTrace(); + } } } \ No newline at end of file