#IFDEF在C# [英] #ifdef in C#

查看:205
本文介绍了#IFDEF在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我愿做以下,但在C#,而不是C ++

 的#ifdef _DEBUG
布尔bypassCheck = TRUE_OR_FALSE; //我将根据我所决定的调试
#其他
布尔bypassCheck = FALSE; //从不绕过它
#万一


解决方案

 #如果DEBUG
布尔bypassCheck = TRUE_OR_FALSE; //我将根据我所决定的调试
#其他
布尔bypassCheck = FALSE; //从不绕过它
#万一

请确保您有复选框,以定义DEBUG在构建性能检查。

I would like to do the below but in C# instead of C++

#ifdef _DEBUG
bool bypassCheck=TRUE_OR_FALSE;//i will decide depending on what i am debugging
#else
bool bypassCheck = false; //NEVER bypass it
#endif

解决方案

#if DEBUG
bool bypassCheck=TRUE_OR_FALSE;//i will decide depending on what i am debugging
#else
bool bypassCheck = false; //NEVER bypass it
#endif

Make sure you have the checkbox to define DEBUG checked in your build properties.

这篇关于#IFDEF在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆