如何使 ILspy c# 反编译结果具有更好的格式?

how to make ILspy c# decompile result have better format?

ILspy 是一个很棒的工具,但是当我使用它反编译 dll 时,我得到的结果是这样的:

this.lastOrientation = base.get_Orientation();

但它应该是这样的:

this.lastOrientation = base.Orientation;

怎样才能得到更好的结果?

更多这样的例子:

应为:

battery_logo.Visibility = System.Windows.Visibility.Visible;

但我们得到的是:

battery_logo.set_Visibility(System.Windows.Visibility.Visible);

构建时会出现如下错误:

'System.Windows.UIElement.Visibility.set': cannot explicitly call operator or accessor

此处有错误报告:https://github.com/icsharpcode/ILSpy/issues/380

有人写道:

It turns out the issue was related to missing dependency assembly an the base type. I no longer see that issue. I am stymied on some obfuscated code though, not sure if you'd be interested in helping me work through that but I'd sure appreciate the help.

您说您正在为 Windows Phone 反编译应用程序。您可以尝试在 ILSpy

中加载 Windows Phone 的引用程序集

ILspy is a amazing tool, but when I use it decompile dll, I have result like this:

this.lastOrientation = base.get_Orientation();

but what it should be is like this:

this.lastOrientation = base.Orientation;

Orientation 可能是 属性 并且 C# 中的属性实际上是一种语法糖,它们在内部简单地转换为引擎盖下的 getter 和 setter 方法 -这就是为什么您看到反编译代码就像是对方法的调用和对常规 属性.

的读取