The great majority of folks loved the new decompilation features in Visual Studio 16.5, but that did not stop me having to field a bunch of important questions about the history of decompilation, and ultimately when this kind of feature should be disabled.

So here is the deal, if you do not want Visual Studio to be able decompile your assembly or module you can use the the SuppressIldasmAttribute:

[assembly: SuppressIldasmAttribute()]
class Program
   static void Main(string[] args)
      Console.WriteLine("The SuppressIldasmAttribute is applied to this assembly.");

The SuppressIldasmAttribute was originally used to stop an assembly or module from being disassembled using the Ildasm.exe (IL Disassembler), and we are using this same attribute to indicate to Visual Studio the same thing.

This results in the following message:

Message Box: Unable to decomiple the module

Happy decompiling … or not as the case may be.

Comment Section

Comments are closed.