build configuration at runtime
am 08.11.2007 19:06:10 von BethHi.
I'm trying to provide information about compile-time options at runtime,
including the build configuration.
I saw in one post that if you set the DEBUG constant, you could rely on it
to determine whether your build is debug or release.
My problem is, I always get the debug value back, even when the build is
configured for release.
Here's my code:
#If DEBUG Then
sBuild = "Debug"
#Else
sBuild = "Release"
#End If
For Each sCommandLineArg In My.Application.CommandLineArgs
sArg = sCommandLineArg.ToString()
If sArg <> "" Then
MsgBox("build is " & sBuild & "," & Chr(13) & _
"server is " & sServer & "," & Chr(13) & _
"db is " & sDB & "," & Chr(13) & _
"connect string is " & sConnect)
End If
Application.Exit()
Next
When I run my .exe from the command line with a switch, it says the build is
debug.
Is there something I'm doing wrong?
I expect to make lots of versions for development, test, and prod and want
to ensure the .exes copied to the sql server are compiled with the correct
variables.
Thanks for any help,
-Beth