Dynamic Session State Mode inside of Web.Config

Discussion in 'ASP .Net' started by Beach Bum, Mar 28, 2005.

  1. Beach Bum

    Beach Bum Guest

    Is there a way to dynamically choose what session state server inside
    of web.config similar in the way you can change options inside of the
    appSettings using the file attribute of the appSettings tag? We are
    using the following setup for our development machines and we would
    like to use a separate Session State Server for our development
    environment

    Inside of web.config:
    <Configuration >
    <appSettings file=optional.config>
    <add key=DB_ServerName
    value="ProductionServer;Database=DB1;Trusted_Connection=True;"/>

    Inside of optional.config (only on development machine):
    <appSettings>
    <add key=DB_ServerName
    value="DevlopmentServer;database=DB1;uid=db_user;pwd=password;"/>
     
    Beach Bum, Mar 28, 2005
    #1
    1. Advertising

  2. Beach Bum

    Brock Allen Guest

    You'll just have to manually change the section in web.config when you deploy
    to different machines (Dev, QA, production, etc...).

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > Is there a way to dynamically choose what session state server inside
    > of web.config similar in the way you can change options inside of the
    > appSettings using the file attribute of the appSettings tag? We are
    > using the following setup for our development machines and we would
    > like to use a separate Session State Server for our development
    > environment
    >
    > Inside of web.config:
    > <Configuration >
    > <appSettings file=optional.config>
    > <add key=DB_ServerName
    > value="ProductionServer;Database=DB1;Trusted_Connection=True;"/>
    >
    > Inside of optional.config (only on development machine):
    > <appSettings>
    > <add key=DB_ServerName
    > value="DevlopmentServer;database=DB1;uid=db_user;pwd=password;"/>
     
    Brock Allen, Mar 28, 2005
    #2
    1. Advertising

  3. Beach Bum

    Beach Bum Guest

    I was trying to avoid this ... is there a way to use an app setting in
    another part of web.config ?

    for example:

    <add key="StateServerMode" value="SQLServer " />
    <add key="StateServerConnection" value="data source=Prod / Dev
    Server;uid=User;pwd=password;" />

    then use something like the following ????

    <sessionState
    mode= StateServerMode
    SqlConnectionString= StateServerConnection
    timeout="20"
    />
     
    Beach Bum, Mar 28, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shamanthakamani
    Replies:
    1
    Views:
    3,523
    Natty Gur
    Nov 20, 2003
  2. Not Liking Dot Net Today
    Replies:
    0
    Views:
    642
    Not Liking Dot Net Today
    Apr 21, 2004
  3. Maciek
    Replies:
    0
    Views:
    8,274
    Maciek
    Sep 15, 2005
  4. jason
    Replies:
    0
    Views:
    819
    jason
    Aug 30, 2006
  5. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,351
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
Loading...

Share This Page