key/value in web.config file

key/value in web.config file

Old forum URL: forums.lhotka.net/forums/t/12090.aspx


fredg posted on Thursday, July 25, 2013

Hi, we are developing a MVC app using CSLA.net. We deploy seperate layers to seperate servers(web server and app server). If BLL uses some key/value setting in web.config, which web.config should we put the key/value setting? Since there are 2 web.config files, one is on web server and another is on application server.

JonnyBee replied on Friday, July 26, 2013

You need to put those key/values where they are used. Could be both or just one of them -  depending on how your code read these values. 

I this is used by business logic only and BLL runs on the application server then that´s the proper place.

fredg replied on Friday, July 26, 2013

Thanks. Actually we put BLL on both web server and application server, so on which web.config should we put the settings if they are used by BLL? Both?

JonnyBee replied on Friday, July 26, 2013

Yes, probably both web.config files.

skagen00 replied on Friday, July 26, 2013

Alternatively you can store them all on the app server and just have a read-only business object to expose the values, fetching this object up-front as part of your startup process - then you'd only have the settings in one location if that's really important to you.

Otherwise yup wherever you need the settings, supply em.

Copyright (c) Marimer LLC