Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Please tell me that If I write code as


C#
//#define DEBUG    //Commented statement


#if DEBUG
        //Some piece of code here
#endif


Whether final executable will contain IL (Intermediate Language) code of this Some piece of code under DEBUG ?????


Thanks............
Posted
Comments
Legor 1-Jul-14 10:26am    
Shouldn't it be
#ifdef DEBUG
?
Matt T Heffron 1-Jul-14 13:06pm    
Legor,
Not in c#.
The only condition for #if *is* the equivalent to #ifdef in c/c++.
Legor 2-Jul-14 3:43am    
Thanks, didn't know.

1 solution

If you don't define the Symbol the code won't be contained - So simple answer "NO", That is the reason for a compiler switch opposed to normal if-else logic)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900