C# 代码取决于构建类型?

C# 代码取决于构建类型?,c#,build,C#,Build,我正在使用Visual c#Express 2008。我希望在“发布”版本中执行一个特殊命令-在创建和运行调试版本时不应执行此命令。是否可以根据生成类型(调试或.Release)实现代码 例如: if(??buildtype?? == "Release") { //... special command ... MessageBox.Show("RELEASE version"); } else { //... normal command ... MessageBox.Show("debu

我正在使用Visual c#Express 2008。我希望在“发布”版本中执行一个特殊命令-在创建和运行调试版本时不应执行此命令。是否可以根据生成类型(调试或.Release)实现代码

例如:

if(??buildtype?? == "Release")
{
 //... special command ...
 MessageBox.Show("RELEASE version");
}
else
{
//... normal command ...
MessageBox.Show("debug release");
}
我必须在项目属性中选中“定义调试内容”吗?
#if DEBUG
  // Commands that should run in debug builds.
#else
  // Commands that should run in release builds.
#endif