From a79a58715450c07b688e58795b02ce9f24a4f5aa Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 21 Sep 2025 18:26:15 +0200 Subject: [PATCH] Fix SaveToDisk default filename suggestion to use the text of the tree node instead. The ToString() implementation returns the tree node path, which always starts with the full path of the loaded assembly. So in my case the suggested file name was always "C" when the assembly was located on the C: drive. --- ILSpy/TextView/DecompilerTextView.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILSpy/TextView/DecompilerTextView.cs b/ILSpy/TextView/DecompilerTextView.cs index a4b39b8de..55c97088d 100644 --- a/ILSpy/TextView/DecompilerTextView.cs +++ b/ILSpy/TextView/DecompilerTextView.cs @@ -1091,7 +1091,7 @@ namespace ICSharpCode.ILSpy.TextView SaveFileDialog dlg = new SaveFileDialog(); dlg.DefaultExt = language.FileExtension; dlg.Filter = language.Name + "|*" + language.FileExtension + Properties.Resources.AllFiles; - dlg.FileName = WholeProjectDecompiler.CleanUpFileName(treeNodes.First().ToString(), language.FileExtension); + dlg.FileName = WholeProjectDecompiler.CleanUpFileName(treeNodes.First().Text.ToString(), language.FileExtension); if (dlg.ShowDialog() == true) { SaveToDisk(new DecompilationContext(language, treeNodes.ToArray(), options), dlg.FileName);