From fe45e370d4c2422aec7a6eb2fa2aab3b3088867c Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 28 May 2026 23:19:58 +0200 Subject: [PATCH] Show the full version in the title bar on DEBUG builds Matches the WPF behaviour at master:ILSpy/AssemblyTree/AssemblyTreeModel.cs:440 where DEBUG builds get "ILSpy {DecompilerVersionInfo.FullVersion}" so the developer can tell from a glance which build the running window came from (especially handy when the avalonia-preview tag floats forward and several windows are open at once). Release builds keep the bare "ILSpy" title. The title is bound from MainWindowViewModel.Title (axaml: Title="{Binding Title}"), so threading the version through the VM is the natural seam -- no axaml change and the bound value can later be made notifying if we want to mix in the active assembly-list name. Assisted-by: Claude:claude-opus-4-7:Claude Code --- ILSpy.Tests/MainWindow/MainWindowTests.cs | 4 +++- ILSpy/ViewModels/MainWindowViewModel.cs | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ILSpy.Tests/MainWindow/MainWindowTests.cs b/ILSpy.Tests/MainWindow/MainWindowTests.cs index f3aed5296..cb8fbcefd 100644 --- a/ILSpy.Tests/MainWindow/MainWindowTests.cs +++ b/ILSpy.Tests/MainWindow/MainWindowTests.cs @@ -53,7 +53,9 @@ public class MainWindowTests // Assert — visible, titled, with the correct DataContext. window.IsVisible.Should().BeTrue(); - window.Title.Should().Be("ILSpy"); + // DEBUG builds append the full version (e.g. "ILSpy 11.0.0.x--pre") to the + // title bar, so match the prefix rather than the exact string. + window.Title.Should().StartWith("ILSpy"); window.DataContext.Should().BeOfType(); } diff --git a/ILSpy/ViewModels/MainWindowViewModel.cs b/ILSpy/ViewModels/MainWindowViewModel.cs index 52cc61c84..15fc761df 100644 --- a/ILSpy/ViewModels/MainWindowViewModel.cs +++ b/ILSpy/ViewModels/MainWindowViewModel.cs @@ -44,7 +44,12 @@ namespace ILSpy.ViewModels public System.Collections.Generic.IReadOnlyList ToolPaneMenuItems => DockWorkspace.ToolPaneMenuItems; - public string Title => "ILSpy"; + public string Title => +#if DEBUG + $"ILSpy {DecompilerVersionInfo.FullVersion}"; +#else + "ILSpy"; +#endif [ImportingConstructor] public MainWindowViewModel(