0

这个问题基于(ILSpy,如何解决依赖关系?

好吧,ILSpy 库发生了变化,现在我们没有 Ast Builder,就像大多数答案一样。

该实例new ICSharpDecompiler有一个可以采用ModuleDefinitionof的重载Mono.Cecil,但我不知道此 ModuleDefinition 是否是此问题的新“解析器”。

在简历中,我需要反编译没有依赖项(dll)的程序集(C#、.dll),我需要使用CSharpDecompiler decompiler = new CSharpDecompiler(dll.Name + ".dll", new DecompilerSettings());没有依赖项的程序集来读取程序集,我该怎么做?

4

1 回答 1

2

我得到了一个简单的解决方案:

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

这将忽略依赖关系,但不会读取具有引用的类型。

于 2018-08-14T20:03:40.483 回答