Decompiling .NET assemblies
One of the best ways to learn how to code for .NET is to see how professionals do it.
Good Practice: You could decompile someone else’s assemblies for non-learning purposes like copying their code for use in your own production library or application, but remember that you are viewing their intellectual property, so please respect that.
Decompiling using the ILSpy extension for Visual Studio 2022
For learning purposes, you can decompile any .NET assembly with a tool like ILSpy:
- In Visual Studio 2022 for Windows, navigate to Extensions | Manage Extensions.
- In the search box, enter
ilspy
. - For the ILSpy 2022 extension, click Download.
- Click Close.
- Close Visual Studio to allow the extension to install.
- Restart Visual Studio and reopen the
Chapter07
solution. - In Solution Explorer, right-click the DotNetEverywhere project and select Open output in ILSpy.
- In ILSpy, in the toolbar...