Thoughts from Dan Miser RSS 2.0
 Tuesday, May 29, 2007
I hate when we lose functionality in applications. I'm writing a pretty classic ASP.NET application right now. One assembly is the Data Access Layer, and I try to write enough unit tests to actually show that things stand a chance of working (both now and in the future). Also, I occasionally like to work at home, disconnected from work's servers (database and other). That means that I have MSSQL installed on my laptop, which has local copies of the databases that I would need. I also have my web.config checked into source control so others on the team can do a simple checkout and have the web site working with a simple build of the MSBuild script. Given that setup, how would one go about being a responsible unit tester? It seems that what I want is a way to set a default connection string in the main config file, and allow a user.config to (optionally) exist. If it did exist, it could override the settings that were in the main config file to point to a new database.

There is a new attribute, configSource, that looks promising because it can be used to redirect .NET from looking at the app.config (or web.config) and instead make it look at an arbitrary generic user.config file for its content. The problem with this approach is that it requires every machine to have this user.config file in the same place. What I want is more like what the old file attribute of appSettings provided. Unfortunately, the new tools in ASP.NET 2.0 get the connection string information from the connectionStrings section, so using the appSettings approach is out-dated.

For now, I'll use configSource, but it is a pain to have to tell each memeber of the dev team that they need to create their very own user.config file and place it in a certain directory, since this usage means that you wouldn't want to check user.config into your source control system.

Take a look at J.D. Meier's paper, How To Reference Web Services and Databases During Development, for some concrete samples on how this looks.

Tuesday, May 29, 2007 11:54:59 AM (Central Standard Time, UTC-06:00)  #    Comments [1] -
.NET | ADO.NET
Tracked by:
http://9qk-information.info/88198857/index.html [Pingback]
http://9op-information.info/55508012/index.html [Pingback]
http://9qf-information.info/68085223/index.html [Pingback]
http://9ql-information.info/90414838/index.html [Pingback]
http://9qt-information.info/43810628/all-star-punti-vendita.html [Pingback]
http://9qt-information.info/31142975/index.html [Pingback]
http://9or-information.info/35729454/index.html [Pingback]
http://9sl-information.info/05057134/index.html [Pingback]
http://9sh-information.info/55213853/index.html [Pingback]
http://9rj-information.info/33590757/index.html [Pingback]
http://9se-information.info/26217874/ulcerosa.html [Pingback]
http://9rm-information.info/57393198/index.html [Pingback]
http://9sk-information.info/37129410/comune-roma-ufficio-condono.html [Pingback]
http://9so-information.info/16683787/busty-dolly.html [Pingback]
http://9uafp-le-informazioni.info/28674668/foto-hollywood-milano.html [Pingback]
http://9uaej-le-informazioni.info/42948299/index.html [Pingback]
http://9uaed-le-informazioni.info/61535503/mediasafe-registration-key-imei-numbe... [Pingback]
http://9uafc-le-informazioni.info/71696975/moto-ecologiche.html [Pingback]
http://9uaek-le-informazioni.info/94175633/index.html [Pingback]
http://9uafo-le-informazioni.info/37807774/poesia-il-sole.html [Pingback]
http://9uafp-le-informazioni.info/64778978/centro-benessere-brescia-beauty-farm.... [Pingback]
http://9uaer-le-informazioni.info/26600206/index.html [Pingback]
http://9uafs-le-informazioni.info/12560795/index.html [Pingback]
http://9uahk-le-informazioni.info/46233651/index.html [Pingback]
http://9uahl-le-informazioni.info/13778829/index.html [Pingback]
http://9uagk-le-informazioni.info/69512299/index.html [Pingback]
http://9uagl-le-informazioni.info/64719927/soluzione-project-zero-3-ps2.html [Pingback]
http://9uahr-le-informazioni.info/26271496/index.html [Pingback]
http://9uahs-le-informazioni.info/05045205/immagini-sacre-santini.html [Pingback]
http://9uahf-le-informazioni.info/57814700/instantnavigation-com-search-php-cat-... [Pingback]
http://9uahd-le-informazioni.info/17452616/o-r-t-h.html [Pingback]
http://9uahl-le-informazioni.info/11152579/solingen.html [Pingback]
http://9uahk-le-informazioni.info/87281519/turismo-portale.html [Pingback]
http://9uahk-le-informazioni.info/95982625/index.html [Pingback]
Navigation
Archive
<August 2008>
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Dan Miser
Sign In
Statistics
Total Posts: 307
This Year: 22
This Month: 1
This Week: 1
Comments: 604
All Content © 2008, Dan Miser
DasBlog theme 'Business' created by Christoph De Baene (delarou)