I just spent about 20 minutes trying to figure out a very dumb problem with my configuration files.
The way I have my configuration setup for my projects is becoming a little cumbersome. I would interested in any other ways people have of accomplishing this because I am ripe for change.
In my folder structure I have it setup like so:
Now, above this folder I have the branches and tags folders, as well as a docs folder that holds any documents, psd files etc so I don’t have to branch/tag any large original files all over the place and increase the size of the svn repository.
As you can see the “lib” folder is any dependencies I have on my projects. Castle, SqlCe and log4net/nhibernate is in the root. In addition I have a app_offline.htm under app_offline that gets copied to the deployment root before the deployment happens, and then deleted after it is finished. Everyone should be doing this!!
Under the “configuration” folder are the following files:
Herein lies the problem…All that is in these files is AppSettings that change depending on where the project is at, for filepaths, specific files etc… If I also develop from a laptop there would be a site.laptop.config that would contain appropriate paths to save files to etc… The appropriate .config file is copied to whereever the app.config is and renamed to site.config, then I tell TortoiseSVN to ignore site.config so that it doesn’t get placed into the project root. With NAnt, I have a task that copies that config file into the right place and renames it to site.config. I know what your’re thinking here, “Well you could use XmlPoke”, which I do for certain things but I can’t always use xmlpoke when I am running on my machine etc..
This is all grand and peachy for myself being the only developer, but then what happens as I bring on more developers? Then I need site.username.desktop.config, for each and every developer. This becomes a real PITA.
I know there has to be a better way to accomplish this other than the way I am doing it now. It has worked so far but it’s becoming a pain to change a setting and then copy the site.whatever.config to the right place and rename it to site.config. I guess I could use pre/post build events but again this seems like to much of a pain.
Does anyone have a better way of doing this? I can’t stand this method anymore. I need something more effecient