Questions tagged [ilspy]

ILSpy is the open-source .NET assembly browser and decompiler.

ILSpy is the open-source .NET assembly browser and decompiler. ILSpy.net

79 questions
2
votes
2 answers

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

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…
gnemoug
  • 467
  • 1
  • 5
  • 21
2
votes
1 answer

Generating code for method call. Generated C# code shows more declared local variables then there actually is in the IL code?

I'm creating an open-instance delegate from a DynamicMethod to call a method on a certain target. The code handles by ref parameters, as well as static methods. See the following: public class Test { public void ByRef(ref int x, int y, out int…
vexe
  • 5,433
  • 12
  • 52
  • 81
2
votes
2 answers

Microsoft Internal property - This property does not have a setter

I was perusing some System classes with ILSpy when I came across this from the System.Internal.HandleCollector class: internal sealed class HandleCollector { ... bunch of stuff removed ... internal static event…
Chuck Savage
  • 11,775
  • 6
  • 49
  • 69
1
vote
1 answer

Decompiling vb.net application

[CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] [AccessedThroughProperty("SimpleButton1")] private SimpleButton _SimpleButton1; internal virtual SimpleButton SimpleButton1 { [CompilerGenerated] …
1
vote
1 answer

Configure ILSpy to show details behind generated code for local method

I trying to see compiler's code for this little sample: static void Main() { int i = 0; AddToI(5); AddToI(10); Console.WriteLine(i); void AddToI(int amount) => i += amount; } I am using ILSpy and it is showing me code almost…
walruz
  • 1,135
  • 1
  • 13
  • 33
1
vote
1 answer

How to get ILSpy to show compiler generated code

I've written and built this app: namespace Test { class Program { static void Main(string[] args) { var myClass = new MyClass(); foreach (var item in myClass.CountFrom(1, 4)) { …
David Klempfner
  • 8,700
  • 20
  • 73
  • 153
1
vote
0 answers

Why Dispose is not called in case of using block and object initializer

Why Dispose() is not called in case of using and object initializer ? I have the following code: public sealed class MyDisposeClass : IDisposable { private int _value; public MyDisposeClass(string str) { …
isxaker
  • 8,446
  • 12
  • 60
  • 87
1
vote
1 answer

How to decompile a specific method generating the same code when decompiled via DecompileTypeAsString

NOOB with ILSPY I'm trying to decompile a method via ILSpy. When I use the following, I get the code re-generated that is pretty close to what was typed in the original C# decompiler.DecompileTypeAsString(new…
Nazeef
  • 11
  • 1
1
vote
1 answer

Why ILSpy is adding variables on stack instead of Instructions?

Why ILSpy is adding variables on stack instead of Instructions? I mean, when pushing or poping from/on stack it adds Ldloc and Stloc instructions. Can anyone explain why it has this behaviour? Thanks!
tairqammar
  • 151
  • 3
  • 10
1
vote
0 answers

How can I see the code for data types?

I tried finding the code for specific data types like float, int and bool in c# using Ilspy, but wasn't able to. Is it possible to find the specific code used for these types in c# using Ilspy or any other way?
Jaswir
  • 172
  • 11
1
vote
1 answer

Find all methods which depend on third-party library

I use ILSpy to explore assemblies. Now I have a task to find all methods in the investigated assembly which depend on a third-party assembly. In other words, I want to know what methods in my assembly call methods in third-party assembly. Is it…
Denis
  • 3,653
  • 4
  • 30
  • 43
1
vote
1 answer

What does the syntax seen when decompiling c# dynamic operations actually mean?

I've recently had to make a forray into decompiling a colleague's code while they're away, and found that most of it looks surprisingly nice (thanks ILSpy), with the notable exception of a couple of places where we needed to use dynamic - these got…
tobriand
  • 1,095
  • 15
  • 29
1
vote
1 answer

ILSpy (a.k.a. .NET Reflector) shows a method as just calling itself, why?

When passing anonymous types to an HtmlHelper method like TextBox, you'll get binding errors (because anonymous type members have internal access only), unless you use a RouteDataDictionary to extract the members. When I saw that the (HtmlHelper…
Triynko
  • 18,766
  • 21
  • 107
  • 173
1
vote
1 answer

ICSharpCode Decompiler get from TypeReferenceExpression to TypeDeclaration?

I'm using ICSharpCode.Decompiler.Ast.AstBuilder (which is used by SharpDevelop, NRefactory and ILSpy under the hood; has taken inspiration from there too) from code to build an abstract syntax tree from a .NET Common Intermediate Language…
Piedone
  • 2,693
  • 2
  • 24
  • 43
1
vote
1 answer

Why can't I decompile System.IdentityModel.Services.dll?

I am trying to decompile System.IdentityModel.Services.dll but none of the decompiling tools show the method details I cannot even get the IL for these methods in ILDASM. Same story for ILSpy. for example: …
9b5b
  • 1,508
  • 11
  • 20