TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chad
NA
1
0
Issue with Precompiler Directive
May 11 2010 7:04 PM
So I have a simple case where I am trying to using a precompile directive to conditionally execute one line of code. Say my code looks like this:
#define BLUE
// ...
#if BLUE
Console.WriteLine("BLUE version");
#endif
So I created a custom build configuration called MyConfig (that copies settings from the RELEASE configuration). If I go to my project properties of the project that has the code above, and select the MyConfig configuration, I add the Conditional Compilation Symbol "BLUE". My thought is that the conditional line should only get executed when the solution is build from the MyConfig configuration.
As a test, I just build the solution in DEBUG model, and set a breakpoint on the code above. Much to my surprise, it actually executed the Console.WriteLine. It seems like everything is configured correclty. Does it look like I did something wrong?
At the end of the day, under most circumstances, I do NOT want the line of code executed. But since my test failed, I am worried that the line could get executed no matter what configuration I build from.
Any thoughts?
Reply
Answers (
0
)
Move multiple shapes in different directions
Why will this line not fire??