"Gary Chang" <v-******@online.microsoft.com> wrote in message
news:Pt*************@cpmsftngxa07.phx.gbl...
From your description, I understand that when you use #IF CONFIG =
"BestRelease", the compiler doesn't recognize the true condition and
doesn't compile statements inside #IF... #END IF block.
Please correct me if there is any misunderstand.
That's right
Either VS desinger doesn't recognize it, not only compiler. Inside the block
I declare some constants, and if I set in release configuration mode I
havent errors, but if I set project in "BestRelease" mode the desinger
reports error where I read this constants.
Is this a bug?
I think it is not a bug, "Config" is a string datatype, which corresponds
to the current setting in the Configuration Manager.
To use the #IF CONFIG = "BestRelease" conditional compilation, I suggest
you to add a new solution configuration "BestRelease" in the Project
Properties.../Configuration Manager/Active Solution Configuration
Please apply my suggestion above and let me know if it helps resolve your
problem.
This is what I made before write the post. But this doesn't work!
I have this code:
#If CONFIG = "Release" Or CONFIG = "Debug" Then
Public Const rootFolderName As String = "one"
Public Const activeBrand As brand = brand.one
#ElseIf CONFIG = "Release_two" Then
Public Const rootFolderName As String = "two"
Public Const activeBrand As brand = brand.two
#End If
If I select Release o Debug configuration profile, all ok.
If I select Release_two, all acceses to two constants reports an error.
However I solved. I noticed that using a third configuration profile I've on
my project, this code works. So I deleted Release_two configuration profile,
and I've created a new Release_two profile copying data from the working
one. Now The code above is working. Any idea of the mistake I made?
I've an other problem. If now I open active solution configuraration, I find
all old profile I don't use. I've tried to delete them (with <Edit...> ->
delete), but if I close and reopen property page, the come back. Any
suggestion?
however.. thanks