From 5b348c4ff7ff3af70ada75665f6295b4161cd759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ku=C4=8Dera?= Date: Fri, 21 Oct 2022 19:24:57 +0100 Subject: [PATCH] include assembly name when decompiling --- ILSpy/Languages/CSharpLanguage.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ILSpy/Languages/CSharpLanguage.cs b/ILSpy/Languages/CSharpLanguage.cs index 492ecf220..703fcd3a6 100644 --- a/ILSpy/Languages/CSharpLanguage.cs +++ b/ILSpy/Languages/CSharpLanguage.cs @@ -156,6 +156,7 @@ namespace ICSharpCode.ILSpy CSharpDecompiler decompiler = CreateDecompiler(assembly, options); AddReferenceAssemblyWarningMessage(assembly, output); AddReferenceWarningMessage(assembly, output); + WriteCommentLine(output, assembly.FullName); WriteCommentLine(output, TypeToString(method.DeclaringType, includeNamespace: true)); var methodDefinition = decompiler.TypeSystem.MainModule.ResolveEntity(method.MetadataToken) as IMethod; if (methodDefinition.IsConstructor && methodDefinition.DeclaringType.IsReferenceType != false) @@ -237,6 +238,7 @@ namespace ICSharpCode.ILSpy CSharpDecompiler decompiler = CreateDecompiler(assembly, options); AddReferenceAssemblyWarningMessage(assembly, output); AddReferenceWarningMessage(assembly, output); + WriteCommentLine(output, assembly.FullName); WriteCommentLine(output, TypeToString(property.DeclaringType, includeNamespace: true)); WriteCode(output, options.DecompilerSettings, decompiler.Decompile(property.MetadataToken), decompiler.TypeSystem); } @@ -247,6 +249,7 @@ namespace ICSharpCode.ILSpy CSharpDecompiler decompiler = CreateDecompiler(assembly, options); AddReferenceAssemblyWarningMessage(assembly, output); AddReferenceWarningMessage(assembly, output); + WriteCommentLine(output, assembly.FullName); WriteCommentLine(output, TypeToString(field.DeclaringType, includeNamespace: true)); if (field.IsConst) { @@ -315,6 +318,7 @@ namespace ICSharpCode.ILSpy CSharpDecompiler decompiler = CreateDecompiler(assembly, options); AddReferenceAssemblyWarningMessage(assembly, output); AddReferenceWarningMessage(assembly, output); + WriteCommentLine(output, assembly.FullName); WriteCommentLine(output, TypeToString(@event.DeclaringType, includeNamespace: true)); WriteCode(output, options.DecompilerSettings, decompiler.Decompile(@event.MetadataToken), decompiler.TypeSystem); } @@ -325,6 +329,7 @@ namespace ICSharpCode.ILSpy CSharpDecompiler decompiler = CreateDecompiler(assembly, options); AddReferenceAssemblyWarningMessage(assembly, output); AddReferenceWarningMessage(assembly, output); + WriteCommentLine(output, assembly.FullName); WriteCommentLine(output, TypeToString(type, includeNamespace: true)); WriteCode(output, options.DecompilerSettings, decompiler.Decompile(type.MetadataToken), decompiler.TypeSystem); }