Home > OS >  ILSpy,How to make IL Code looks more like native C# instead of machine code
ILSpy,How to make IL Code looks more like native C# instead of machine code

Time:11-21

this is my result

this is what i want to see

I've only just started using ILSpy,the dll is compined with Unity Self,and i just drag the Assembly-CSharp.dll into ILSpy,I have searched for a long time but nothing leaned.Is there some setting i need?

CodePudding user response:

What do you even mean?

C# code is COMPILED INTO IL CODE.

IL Code does not look like C# code because it is another language. If you drag an assembly into ILSpy it can only show you the IL - why the heck would it show you anything that even remotely looks like C# Code? ILSpy is there to show you the IL Code - you can not make that IL Code look like C# code. This is like "how do I make english follor german syntax".

Now, there are decompilers. The answer for them is: Write IL code as the compiler would.

CodePudding user response:

In the top menubar of ILSpy you can see a combobox/dropdown, which selects the decompiler's output target language. I suspect it is set to IL in your case. Change its value to C#, and your situation should improve...

  • Related