开发者

define DEBUG symbol on a VS2010 Website?

开发者 https://www.devze.com 2023-02-08 08:41 出处:网络
I can\'t f开发者_开发知识库ind where this setting is #if !DEBUG //some code #endif when I change the configuration dropdown from debug to release, I see no changes in my code, which suggests that

I can't f开发者_开发知识库ind where this setting is

#if !DEBUG
//            some code
#endif

when I change the configuration dropdown from debug to release, I see no changes in my code, which suggests that my DEBUG symbol is not defined

EDIT

I do not see the setting in the Buid screen as Mark suggests:

define DEBUG symbol on a VS2010 Website?


If you go to the properties on the project (the website), go to the Build tab and make sure Define DEBUG constant is checked.

This setting can be changed for each build configuration.


If Mark's answer doesn't do it, try changing to

#ifndef DEBUG

 /* ... */

#endif

or optionally

#if !defined(DEBUG)

 /* ... */

#endif

and see if that helps?


In Web.config, change the compilation section to:

<compilation debug="false">

or

<compilation debug="true">

Worked for me, but it's annoying there is no option in the build screen.

0

精彩评论

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