views:

71

answers:

1

Hi all

I'm developing a feature for MOSS which stores some environment-specific config data in feature.xml (like connection string).

I would like to have a separate .properties file for each environment and make it automatically substitute appropriate values to where needed (like feature.xml) while building. Is that possible and what tools can I use (I suppose, NAnt?)

Thank you!

Regards, Anton

A: 

Wouldn't it be easier to just store all those values in a (hidden) list in the site collection, that way your solution stays clean and env. independend, allowing for values to be set through the UI (or powershell even) instead of including them in your solution, which IMHO isn't very clean architecture / maintenance wise.

Colin
Thanks! So I guess developing MOSS features requires a bit different approach comparing to java apps? In java world I often used so called "profiles" which are just .properties files (like prod.propertires, uat.properties) with config values. Values from these profiles were inserted to where required while building (like build -profile=prod).Is the way you described common for MOSS world? I.e. I should store all configuration data in lists instead of feature config files.
Anton Polyakov
Either lists or web.config. Depends on how secure you want the properties to be with regards to people being able to read for instance connection strings. Making the list hidden and only accessible to admins and getting those properties in code by using RunWithElevatedPriviliges makes the list more secure, but still accessible by site admins. If you really want to go with per environment settings in the web.config I suggest looking into creating custom build targets, which are basaically the same as the "build -profile=prod" you mentioned.
Colin
Thanks! Can you give me a hint about custom build targets? Are there any standard ways of implementing this?
Anton Polyakov