Updated Getting Started With ICSharpCode.Decompiler (markdown)

master
Siegfried Pammer 3 years ago
parent
commit
7ffdea9eee
  1. 4
      Getting-Started-With-ICSharpCode.Decompiler.md

4
Getting-Started-With-ICSharpCode.Decompiler.md

@ -1,4 +1,4 @@
**Note: Please refer to the [Xamarin workbook](https://github.com/icsharpcode/ILSpy/blob/master/DecompilerNuGetDemos.workbook) for always up-to-date samples.**
**Note: Please refer to the [Jupyter notebook](https://github.com/icsharpcode/ILSpy/blob/master/decompiler-nuget-demos.ipynb) for always up-to-date samples.**
1) Create a new project and add the `ICSharpCode.Decompiler` nuget to your project.
2) Add the following usings to your code:
@ -32,7 +32,7 @@ Console.WriteLine(decompiler.DecompileTypeAsString(name));
```cs
var decompiler = new CSharpDecompiler("Demo.ConsoleApp.exe", new DecompilerSettings());
var name = new FullTypeName("Demo.ConsoleApp.Test+NestedClassTest");
ITypeDefinition typeInfo = decompiler.TypeSystem.MainModule.Compilation.FindType(name).GetDefinition();
ITypeDefinition typeInfo = decompiler.TypeSystem.FindType(name).GetDefinition();
var tokenOfFirstMethod = typeInfo.Methods.First().MetadataToken;
Console.WriteLine(decompiler.DecompileAsString(tokenOfFirstMethod));
```

Loading…
Cancel
Save