I have something like this in my code that checks for user's license:

// C# code:


Now, I need to know if these directives get saved in my released binary or not. If they do get saved, then a user can make #if DEBUG return true and bypass the checks. I need to know if #if DEBUG is safe.

1 Answer 1


best to put the code inside the MakeLicenseValidForever into #if DEBUG,too. those #if things get processed at compile time and only the code of the taken path exists. Functions don't get stripped if not referenced thats why its best to empty out the function that should not exist in the release binary. They are similar to the C #ifdefs for preprocessor based stripping

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.