Tuesday, August 28, 2018

c# - Debug.Assert Appears in Release Mode




We all know that Debug.Assert will not be compiled into the dlls when compiled in release mode. But for some reason Debug.Assert did appear in the release version of a component I wrote. I suspect that I might have mess up my csproject setting.



Any idea why Debug.Assert appears in release mode?



P/S: I have double checked to make sure that I was really compiling in release mode before asking this question.



Note 2: I've double checked my csproject, and I found that in the Release config, the Define DEBUG constant is not ticked, indicating that for this part my setting is correct.


Answer



I found out the answer; it's because there is a #define DEBUG preprocessor defined at the start of a cs file inside the project. Removing it solves the problem


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...