mercredi 9 décembre 2020

if constexpr in C# [duplicate]

My short question: Is there something like if constexpr in C#?

More explanation: I'm developing a C# app that has a free and a pro version and the pro version is going to have a separate executable. But all the difference between them in my code is a constant bool:

const bool FREE_VERSION = true;

some codes are like:

if(!FREE_VERSION)...

In C++, with if constexpr such code is not compiled at all so there is no way to hack the executable.

Is there any similar feature in C# so that I can be sure that the pro version code does not exist in the final free-version executable?

Aucun commentaire:

Enregistrer un commentaire