开发者

code depending on build-type?

开发者 https://www.devze.com 2022-12-18 22:24 出处:网络
I\'m using Visual c# Express 2008. I want to have a special command executed just in \"Release\" builds - this command should not be executed while I\'m creating and running Debug versions. Is it poss

I'm using Visual c# Express 2008. I want to have a special command executed just in "Release" builds - this command should not be executed while I'm creating and running Debug versions. Is it possible to implement code depending on my build-type (Debug or. Release)?

For example:

if(??buildtype?? == "Release")
{
 //... special command ...
 MessageBox.Show("RELEASE version");
}
else
{
//... normal command ...
MessageBox.Show("debu开发者_StackOverflow中文版g release");
}


#if DEBUG
  // Commands that should run in debug builds.
#else
  // Commands that should run in release builds.
#endif
0

精彩评论

暂无评论...
验证码 换一张
取 消