asp.net - Change Web.config session value in Global.ascx? -


we storing session data in database, ideally each developer wants session database on own pcs, or possibly 1 developer might use inproc, mssql connection, oracle (if working)

is possible? can access session key in code , change in application startup? or there file merged web.config file wouldn't checked in?

or option c easier haven't thought of :-)

thanks

(edit) found goes in detail developer specific app.config/web.config files in visual studio

(answer). came mix of andrew barber in comments , above

(1) in web.config have

<sessionstate configsource="systemweb.config" /> 

(2) make file called systemwebdefault.config holds this:

<sessionstate mode="sqlserver" allowcustomsqldatabase="true" etc 

(3) each developer has copy default file called systemweb.config, changing suit themselves. file should explicitly ignored in subversion or whatever source control system use.

(4) build box needs copy step

something might want nconfig (nuget link). i've used on projects let multiple developers in our team have different connection strings local db copies. lets define machine specific config file replace default config values. example can define {machinename}.custom.config might this:

<?xml version="1.0"?> <configuration>   <connectionstrings>     <add name="main" connectionstring="data source=(local)\sqlexpress;uid=username;pwd=password;initial catalog=mydb" providername="system.data.sqlclient" />   </connectionstrings> </configuration> 

i've never tried session settings, can't find says won't work.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -