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

如何使ILspy c#反编译结果具有更好的格式?,c#,windows,ilspy,C#,Windows,Ilspy,ILspy是一个令人惊奇的工具,但当我使用它反编译dll时,我得到如下结果: this.lastOrientation = base.get_Orientation(); this.lastOrientation = base.Orientation; this.lastOrientation = base.get_Orientation(); this.lastOrientation = base.Orientation; 但它应该是这样的: this.lastOrientation

ILspy是一个令人惊奇的工具,但当我使用它反编译dll时,我得到如下结果:

this.lastOrientation = base.get_Orientation();
this.lastOrientation = base.Orientation;
this.lastOrientation = base.get_Orientation();
this.lastOrientation = base.Orientation;
但它应该是这样的:

this.lastOrientation = base.get_Orientation();
this.lastOrientation = base.Orientation;
this.lastOrientation = base.get_Orientation();
this.lastOrientation = base.Orientation;
我怎样才能得到更好的结果

更多类似的例子:

this.lastOrientation = base.get_Orientation();
this.lastOrientation = base.Orientation;
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

这里有一个bug报告:

有人写道:

原来问题与缺少基类型的依赖程序集有关。我不再看到这个问题。我在一些模糊的代码上遇到了麻烦,不知道你是否有兴趣帮我解决这个问题,但是我非常感谢你的帮助

你说你正在反编译Windows Phone的应用程序。您可以尝试在ILSpy中加载Windows Phone的引用程序集

ILspy是一个了不起的工具,但当我使用它反编译dll时,我有 结果如下:

this.lastOrientation = base.get_Orientation();
this.lastOrientation = base.Orientation;
this.lastOrientation = base.get_Orientation();
this.lastOrientation = base.Orientation;
但它应该是这样的:

this.lastOrientation = base.get_Orientation();
this.lastOrientation = base.Orientation;
this.lastOrientation = base.get_Orientation();
this.lastOrientation = base.Orientation;

Orientation
可能是一个属性,而c#中的属性实际上是一种语法糖,它们在内部简单地转换为getter和setter方法,这就是为什么您会看到反编译代码,就好像它是对方法的调用和对常规属性的读取一样。

但是
get_Orientation()
也是可读的,并解释了如何在btwYes内部实现属性,但这不是推荐的方法。这不会发生在我身上(这将是错误的,因为如果
Orientation
是一个属性,在C中就无法直接调用getter方法)@xanatos,您配置了ilspy吗?我得到的总是将属性设置为getter或setter方法。您确定没有使用ILSpy的史前版本吗?作为比较,我使用的是2.3.0.1827