To do this, go to the Modules window and from the context menu of a . NET assembly, and then select the Decompile source code command. Visual Studio generates a symbol file for the assembly and then embeds the source into the symbol file. In a later step, you can extract the embedded source code.
There are many . NET decompilers that you can use as an alternative to DnSpy like ilspy, justDecompile telerik decompiler, jetbrains dotPeek decompiler, Spices . NET decompiler, Redgate . NET Reflector and more (you can find them for Windows, Linux or macOs).
You can now use Visual Studio to decompile managed code even if you don't have the symbols, allowing you to look at code, inspect variables and set breakpoints.
Select only with “Anti IL Dasm” and “Anti Tamper”, that is enough for making it hard enough to reverse engineer for the decompilers. After you click on Done, go to Protect tab and click on Protect button. You can find the protected DLL or EXE in the output directory selected.
Now that Red Gate have started charging for the .NET Reflector tool you might want to check out these free alternatives instead...
Telerik JustDecompile
JetBrains dotPeek
(Open Source) ILSpy
Have you looked at Reflector?
http://www.red-gate.com/products/reflector/
Reflector is the way to go, but if you can't use that for some reason, Microsoft ships a disassembler called ILDasm with the framework.
A good source for MSIL knowledge is the book Expert .NET 2.0 IL Assembler by Serge Lidin.
.NET Reflector is the usual tool for this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With