How to compile my C# code in "microsoft way"?

Tomer.Z 96 Reputation points
2022-01-04T19:56:13.343+00:00

As known to all C# compiles to MSIL.
There are tools like NGEN, crossgen and even crossgen2 - all of them compile to R2R alongside with MSIL.

I would like to hide my code, i know know.. "reverse engineering is always possible, but there is a difference between "see you naked" and "imagine you naked".

There are also obfuscators who prevents decompilation, but these can be easily reversed too.

My question is this: what Microsoft does to hide their code when they ship they products?
Visual Studio for example, or even Windows OS itself are partly written in C#, so how come their code cannot be decompiled using ILspy?

Are they using a"secret tool" they do not share?

I just want to have the same result for my assemblies, where no one can see me naked.

.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
322 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 26,426 Reputation points Microsoft Vendor
    2022-01-05T05:54:52.727+00:00

    Hi @Tomer.Z ,
    You can check this question below.
    How can I protect my .NET assemblies from decompilation?
    Hope this could be helpful.
    Best Regards.
    Jiachen Li

    ----------

    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments