Reputation: 467
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;
how can I get the better result?
more examples like this:
It shall be:
battery_logo.Visibility = System.Windows.Visibility.Visible;
but what we get is:
battery_logo.set_Visibility(System.Windows.Visibility.Visible);
When we build will get error like:
'System.Windows.UIElement.Visibility.set': cannot explicitly call operator or accessor
Upvotes: 2
Views: 2340
Reputation: 13003
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
is probably a property and Properties in c# are actually kind of syntactic sugar and they internally simply translated to getter & setter methods under the hood - This is why you see the decompiled code as if it was a call to a method and a read of a regular property.
Upvotes: 1
Reputation: 111820
There is a bug report here: https://github.com/icsharpcode/ILSpy/issues/380
Someone wrote:
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.
You said that you are decompiling an app for Windows Phone. What you could try is loading the referenced assemblies of Windows Phone in ILSpy
Upvotes: 5