You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C# output of "Save Code" in ILSPY and the C# output I generated using ICSharpCode.Decompiler.dll are different.
C# code generated from ILSPY can successfully list all namespaces in Roslyn, while C# output generated using ICSharpCode.Decompiler.dll can access very few namespaces in Roslyn.
At the same time, while the C# code generated from ILSPY can be displayed with correct colouring in Visual Studio, part of the C# code generated in ICSharpCode.Decompiler.dll can be coloured correctly, the other part is displayed as if it were text.
When the code generated from both systems is compared with winmerge, it can be seen that although the majority of the code is the same, there are parts that are different.
I am doing this on a Windows 10 machine.
Versions used:
ILSPY :
ILSpy version 8.2.0.7535
.NET version 6.0.26-servicing.23605.8+dc45e96840243b203b13e61952230e225d2aac52
The code block that I generated the C# code using ICSharpCode.Decompiler.dll is as follows :
PEFile peFile = new PEFile(dll);
var resolver = new UniversalAssemblyResolver(dll, true, peFile.DetectTargetFrameworkId(), null, System.Reflection.PortableExecutable.PEStreamOptions.Default, System.Reflection.Metadata.MetadataReaderOptions.ApplyWindowsRuntimeProjections);
var decompilerSettings = new DecompilerSettings()
{
ParameterNullCheck = true,
QueryExpressions = true,
SeparateLocalVariableDeclarations = true
};
var decompiler = new CSharpDecompiler(peFile, resolver, decompilerSettings);
var csharpcode = decompiler.DecompileWholeModuleAsString();
The text was updated successfully, but these errors were encountered:
The C# output of "Save Code" in ILSPY and the C# output I generated using ICSharpCode.Decompiler.dll are different.
C# code generated from ILSPY can successfully list all namespaces in Roslyn, while C# output generated using ICSharpCode.Decompiler.dll can access very few namespaces in Roslyn.
At the same time, while the C# code generated from ILSPY can be displayed with correct colouring in Visual Studio, part of the C# code generated in ICSharpCode.Decompiler.dll can be coloured correctly, the other part is displayed as if it were text.
When the code generated from both systems is compared with winmerge, it can be seen that although the majority of the code is the same, there are parts that are different.
I am doing this on a Windows 10 machine.
Versions used:
ILSPY :
ILSpy version 8.2.0.7535
.NET version 6.0.26-servicing.23605.8+dc45e96840243b203b13e61952230e225d2aac52
ICSharpCode.Decompiler.dll :
File Version: 8.2.0.7535-95108c96
Product Version: 8.2.0.7535-95108c96
The code block that I generated the C# code using ICSharpCode.Decompiler.dll is as follows :
PEFile peFile = new PEFile(dll);
var resolver = new UniversalAssemblyResolver(dll, true, peFile.DetectTargetFrameworkId(), null, System.Reflection.PortableExecutable.PEStreamOptions.Default, System.Reflection.Metadata.MetadataReaderOptions.ApplyWindowsRuntimeProjections);
var decompilerSettings = new DecompilerSettings()
{
ParameterNullCheck = true,
QueryExpressions = true,
SeparateLocalVariableDeclarations = true
};
var decompiler = new CSharpDecompiler(peFile, resolver, decompilerSettings);
var csharpcode = decompiler.DecompileWholeModuleAsString();
The text was updated successfully, but these errors were encountered: