New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Save Code" in ILSpy results in different source compared to the code shown in UI #1674
Comments
For this discussion there is one important distinction to make: between the ICS.Decompiler NuGet package and the ILSpy frontend. ICS.D was specifically re-architected in v4 to move from Cecil to System.Reflection.Metadata. Frontends like ILSpy on the other hand can take those dependencies, that is why there is a PDB Provider interface that does take a Cecil dependency. |
I guess there are a few misunderstandings here: One part of this issue discusses the debug info:
The other part is about the missing option to allow passing decompiler settings to the powershell and cmdline frontends. |
Yes. That is a valid point. Actually I really was afraid of this changes in project references. Perhaps the provider are again refactored to a new assembly that is subsequently available to the powershell frontend and ILSpy. I somehow liked the idea of this Currently my solution fits my needs but I confess, I was not digging in the project history. |
No, the Nuget distribution of |
ILSpy allows configuration of
DecompilerSettings
in the options dialog and this settings are applied in the UI text editor.When calling the "Save Code" function from the menu bar, or the assembly context menu, different code is generated. Here the ILSpy
DecompilerSettings
are not respected, neither do the variable names follow those from the debug symbols in pdb files. Here new instances ofICS.Decompiler
are created with hard codedDecompilerSettings
and lostDebugInfoProvider
.Also the pwsh cmdlets have no possibility to specify
DecompilerSettings
. Again, the debug symbols are not respected when generating cs code.This issue was already brought up in #1328 and #1426 where it was vaguely described and thus rejected.
Especially the feature to preserve the
DebugInfoProvider
is painful as it means making thePortableDebugInfoProvider
andMonoCecilDebugInfoProvider
available forICS.Decompiler
.In my opinion, these two providers are no UI features, but technically required for proper csharp code, thus the transfer to
ICS.Decompiler
is consistent. Talking about the referenced Mono.Cecil: The final compile output contain this libraries anyhow.The text was updated successfully, but these errors were encountered: