Upgrade to v6 ILSpy libraries
Piedone opened this issue · comments
See important info:
- https://github.com/icsharpcode/ILSpy/wiki/ILSpy-3.0-Release-Notes
- https://github.com/icsharpcode/ILSpy/wiki/newdecompiler
- https://github.com/icsharpcode/ILSpy/wiki/Getting-Started-With-ICSharpCode.Decompiler Check this on how to start with decompilation with
DecompilerContext
andAstBuilder
removed.
Also:
- ICSharpCode.NRefactory was integrated into ICSharpCode.Decompiler and thus the independent ICSharpCode.NRefactory package isn't used any more.
ILRange
is now part ofILInstruction
instead of being an annotation.- Not sure what "Instead of Cecil.TypeReference, the decompiler now uses the NRefactory TypeSystem." means for us, but probably we can still get the Cecil type info object as per the former, now deleted, last example on https://github.com/icsharpcode/ILSpy/wiki/Getting-Started-With-ICSharpCode.Decompiler (
GetCecil()
doesn't exist any more):
var decompiler = new CSharpDecompiler("Demo.ConsoleApp.exe", new DecompilerSettings());
var name = new FullTypeName("Demo.ConsoleApp.Test+NestedClassTest");
ITypeDefinition type = decompiler.TypeSystem.Compilation.FindType(name).GetDefinition();
var module = decompiler.TypeSystem.GetCecil(type).Module
But with v4.0, the underlying decompiler and disassembler engine have been ported to System.Reflection.Metadata, see: https://github.com/icsharpcode/ILSpy/wiki/srm
There is still TypeDeclaration
but now there is also an ITypeDefinition
which is similar to what was in Mono.Cecil and can be retrieved from various places via GetDefinition()
. Then there is IEntity.MetadataToken
as well, which is supposed to provide what GetCecil()
did.
After this, the workaround for the ILSpy large integer literal bug can be removed, see DecompilationErrorsFixer
and WronglyDecompiledCases
.
Done, will be part of the next release.
Guys this was an epic upgrade :D. @siegfriedpammer @christophwille @dgrunwald But it's very well worth it. I could remove a lot of workarounds and special case handling from Hastlayer.