Question Converted project; #If DEBUG does not work anymore

dixonline

New member
Joined
Aug 4, 2008
Messages
2
Programming Experience
3-5
Fellow Dot Net coders,

I have converted a VS 2003 project to VS 2005. It's a Windows application written in VB. Since the conversion, the #If DEBUG statement does not do it's work anymore. For example, with the following code;

VB.NET:
#If DEBUG Then
        MsgBox("Debug mode")
#Else
        MsgBox("Release mode")
#End If

I go to Build -> Configuration Manager switch between Debug/Release mode. I get the 'Debug mode' message in both modes. When I create a new project and do exactly the same then I do get the 'Release mode' message in Release mode.

Can anyone explain how this problem might have originated and how to resolve it?

(of course the 'define DEBUG constant' at project properties is checked)
 
Solved it...

I had to deselect the 'define DEBUG constant' checkbox in Release mode. I now understand the Configuration Manager :)
 
Back
Top