How to decompile assembly without have the dependencies

499 Views Asked by At

This question is based in (ILSpy, how to resolve dependencies?)

Well, the ILSpy library changed and now we don't have Ast Builder, like the most answers about this.

The instance new ICSharpDecompiler have a overload that can take a ModuleDefinition of Mono.Cecil, but I don't know if this ModuleDefinition is the new "Resolver" for this issue.

In the resume I need to decompile a assembly (C#, .dll) that I don't have the dependecies (dll), I need to read the assembly using CSharpDecompiler decompiler = new CSharpDecompiler(dll.Name + ".dll", new DecompilerSettings()); without have the dependencies, how can I do that?

1

There are 1 best solutions below

0
On

I got the solution making a simple:

CSharpDecompiler decompiler = new CSharpDecompiler("name.dll", new DecompilerSettings() {ThrowOnAssemblyResolveErrors = false})

This will ignore the dependencies but the types with references will not be read.