Conditional compile based upon Active Configuration

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SStory

    Conditional compile based upon Active Configuration

    I would like to have some code compile if my Active Configuration is set to
    debug and not compile if it is set to Release.

    I don't want to have to remember to define a constant. I just want to
    change configurations and all debug code not execute.

    How is this possible.

    Thanks in advance,

    Shane


  • Herfried K. Wagner [MVP]

    #2
    Re: Conditional compile based upon Active Configuration

    "SStory" <TheStorys@TAKE THISSPAMBUSTERO UT.Softhome.net > schrieb:[color=blue]
    > I would like to have some code compile if my Active
    > Configuration is set to debug and not compile if it
    > is set to Release.
    >
    > I don't want to have to remember to define a constant.
    > I just want to change configurations and all debug code
    > not execute.[/color]

    \\\
    #If Debug Then
    ...
    #End If
    ///

    Select the project in the project explorer, select the "Project" menu ->
    "Properties " -> "Configurat ion Settings" -> "Build" -> "Define DEBUG
    constant" (translated from the German language version of VS.NET 2002).

    --
    Herfried K. Wagner
    MVP · VB Classic, VB.NET
    <http://www.mvps.org/dotnet>


    Comment

    • SStory

      #3
      Re: Conditional compile based upon Active Configuration

      cool , I found it.
      Thre is a checkbox that says Defin Debug Constant already checked in the
      debug configuration.
      That is what I wanted to do.

      I can't always remember to define one. This will be helpful. Keep me from
      burning a CD with Debug code still in.

      Danke Herr Wagner, Guten Aben (I think good evening... not sure.... I
      remember, Guten Morgan,Guten tag, Guten Aben...)

      Shane


      "Herfried K. Wagner [MVP]" <hirf.nosp@m.ac tivevb.de> wrote in message
      news:eAlDKA0cDH A.2436@TK2MSFTN GP09.phx.gbl...[color=blue]
      > "SStory" <TheStorys@TAKE THISSPAMBUSTERO UT.Softhome.net > schrieb:[color=green]
      > > I would like to have some code compile if my Active
      > > Configuration is set to debug and not compile if it
      > > is set to Release.
      > >
      > > I don't want to have to remember to define a constant.
      > > I just want to change configurations and all debug code
      > > not execute.[/color]
      >
      > \\\
      > #If Debug Then
      > ...
      > #End If
      > ///
      >
      > Select the project in the project explorer, select the "Project" menu ->
      > "Properties " -> "Configurat ion Settings" -> "Build" -> "Define DEBUG
      > constant" (translated from the German language version of VS.NET 2002).
      >
      > --
      > Herfried K. Wagner
      > MVP · VB Classic, VB.NET
      > <http://www.mvps.org/dotnet>
      >
      >[/color]


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Conditional compile based upon Active Configuration

        "SStory" <TheStorys@TAKE THISSPAMBUSTERO UT.Softhome.net > schrieb:[color=blue]
        > Danke Herr Wagner, Guten Aben (I think good evening... not sure.... I
        > remember, Guten Morgan,Guten tag, Guten Aben...)[/color]

        "Guten Abend", "Guten Tag", "Guten Morgen"

        ;-)

        --
        Herfried K. Wagner
        MVP · VB Classic, VB.NET
        Die Website von H. Wagner zu .NET, Visual Basic .NET und Classic Visual Basic.



        Comment

        Working...