PC Review


Reply
Thread Tools Rate Thread

Conditional compiling C#

 
 
Magne Ryholt
Guest
Posts: n/a
 
      16th Mar 2005
Using VS.net 2003 (C#)

Code:
:
#if DEBUG
something
#else
something else
#endif

When I switch the build configuration to release, the code in the #if DEBUG
path is still compiled (and executed)
I have checked the "Conditional Compilation Constants" in the project
properties settings, and they look ok
(DEBUG; TRACE for debug and TRACE for release)

Any ideas ?


 
Reply With Quote
 
 
 
 
Brendan Grant
Guest
Posts: n/a
 
      16th Mar 2005
When you switch between debug and release mode... does the
colorization of the two code blocks (separated by the
#else) change at all?

Any chance that you are accidentally defining DEBUG
somewhere else?

>-----Original Message-----
>Using VS.net 2003 (C#)
>
>Code:
>:
>#if DEBUG
> something
>#else
> something else
>#endif
>
>When I switch the build configuration to release, the

code in the #if DEBUG
>path is still compiled (and executed)
>I have checked the "Conditional Compilation Constants" in

the project
>properties settings, and they look ok
>(DEBUG; TRACE for debug and TRACE for release)
>
>Any ideas ?
>
>
>.
>

 
Reply With Quote
 
Magne Ryholt
Guest
Posts: n/a
 
      17th Mar 2005
Yes they are dimmed as they should, and I found the problem.
The problem was that last night was too late
(I was running what I thought was the release version from the debug
directory)

Sorry to bother you, thanks anyway.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional compiling lgs.lgs Microsoft C# .NET 10 30th Mar 2006 12:51 AM
Conditional compiling between Excel Versions Ken Soenen Microsoft Excel Programming 7 4th Mar 2006 12:43 AM
compiling dll Dan Microsoft VB .NET 5 18th Feb 2005 01:06 AM
Question about References in Code Is it possible to conditional compiling on references? Roger Microsoft Access 1 21st Jan 2005 06:32 PM
Stop compiling doesn't stop compiling Rudy Ray Moore Microsoft VC .NET 0 5th May 2004 12:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:32 AM.