where to set a development variable?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Keith G Hicks

    where to set a development variable?

    In my windows apps I always set a global development variable so that I can
    toggle certain blocks of code back and forth between production and
    development settings. I'll run some startup code that sets something like
    DevVar = TRUE or DevVar = FALSE and then do this in code where needed:

    If DevVar Then
    ....do something
    ELSE
    ... do something else
    END IF


    I have no idea where to set something like (web.config, some global vb code
    unit???) that in an asp.net 2.0 app and what it would be (session var??).
    Looking for any advice.

    Thanks,

    Keith


  • Mark Rae [MVP]

    #2
    Re: where to set a development variable?

    "Keith G Hicks" <krh@comcast.ne twrote in message
    news:%23zghhYyf IHA.748@TK2MSFT NGP04.phx.gbl.. .
    Looking for any advice.



    --
    Mark Rae
    ASP.NET MVP


    Comment

    • Keith G Hicks

      #3
      Re: where to set a development variable?

      This is pretty much what I was looking for:

      <configuratio n>
      <!-- application specific settings -->
      <appSettings>
      <add key="connString " value="connecti on string" />
      </appSettings>

      <system.web>
      ...
      </system.web>
      </configuration>" Keith G Hicks" <krh@comcast.ne twrote in message
      news:#zghhYyfIH A.748@TK2MSFTNG P04.phx.gbl...
      In my windows apps I always set a global development variable so that I
      can
      toggle certain blocks of code back and forth between production and
      development settings. I'll run some startup code that sets something like
      DevVar = TRUE or DevVar = FALSE and then do this in code where needed:
      >
      If DevVar Then
      ....do something
      ELSE
      ... do something else
      END IF
      >
      >
      I have no idea where to set something like (web.config, some global vb
      code
      unit???) that in an asp.net 2.0 app and what it would be (session var??).
      Looking for any advice.
      >
      Thanks,
      >
      Keith
      >
      >

      Comment

      • Mark Rae [MVP]

        #4
        Re: where to set a development variable?

        "Keith G Hicks" <krh@comcast.ne twrote in message
        news:OKn2IJzfIH A.536@TK2MSFTNG P06.phx.gbl...
        >In my windows apps I always set a global development variable so that I
        >can
        >toggle certain blocks of code back and forth between production and
        >development settings. I'll run some startup code that sets something like
        >DevVar = TRUE or DevVar = FALSE and then do this in code where needed:
        >>
        >If DevVar Then
        > ....do something
        >ELSE
        > ... do something else
        >END IF
        >>
        >
        This is pretty much what I was looking for:
        >
        <configuratio n>
        <!-- application specific settings -->
        <appSettings>
        <add key="connString " value="connecti on string" />
        </appSettings>
        >
        <system.web>
        ...
        </system.web>
        OK, but that's actually not what you asked for... You asked for a method to
        use a variable to toggle *blocks of code*, and even gave an example of it,
        which is why I gave you the Google link for articles on how to do
        conditional compilation in ASP.NET...

        If you are now saying that you want to be able to use, essentially,
        different web.configs for development / production etc, then you need this:



        --
        Mark Rae
        ASP.NET MVP


        Comment

        Working...