Home All Groups Group Topic Archive Search About

Dynamic Session State Mode inside of Web.Config

Author
28 Mar 2005 4:50 PM
Beach Bum
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;"/>

Author
28 Mar 2005 6:20 PM
Brock Allen
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



Show quoteHide quote
> 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;"/>
Are all your drivers up to date? click for free checkup

Author
28 Mar 2005 7:18 PM
Beach Bum
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"
/>

Bookmark and Share