Debug.Assert的出现在释放模式 [英] Debug.Assert Appears in Release Mode
问题描述
我们都知道, Debug.Assert的
在发布模式下进行编译时不会被编译成动态链接库。但由于某些原因 Debug.Assert的
的没有的出现在我写的一个组成部分的发行版本。我怀疑我有可能搞砸了我的csproject设置。
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.
任何想法,为什么 Debug.Assert的
出现在释放模式?
Any idea why Debug.Assert
appears in release mode?
P / S:我有双重检查,以确保我真的是在释放模式编译问这个问题之前。
P/S: I have double checked to make sure that I was really compiling in release mode before asking this question.
注2:我双重检查我的csproject,我发现,在发布配置,在定义DEBUG常数没有打勾,这表明这部分我的设置是正确的。
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.
推荐答案
我找到了答案;这是因为在项目内的CS文件的开始定义的将#define DEBUG
预处理器。删除它解决了这个问题。
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
这篇关于Debug.Assert的出现在释放模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!