Environment-Specific Configuration creation

Topics: Enterprise Library Core
Jul 31, 2008 at 12:01 PM

I am new to Entlib 4.0 so please be patient...

Here is my problem:
- open the Entlib configuration tool in VS2K8
- add an environment in the 'Environment' node
- give it an 'EnvironmentConfigurationFile' value
- save
- close the app.config
- open it again ... the Environment is gone

What may I do wrong?
Jul 31, 2008 at 1:54 PM

The environments are not saved in the configuration file, so you need to reload them. Right click on the Environments node, then select Open environment delta and pick your file.

This is unfortunately not clearly documented in the help file.

Aug 1, 2008 at 8:11 AM

Indeed it is not well documented on my opinion, but I will go on with my tests.

Thanks for your reply  :)
Aug 11, 2008 at 8:31 PM
I can understand how a build tool could use this .dConfig to merge with the Web.Config, but how to do this without a build tool?  If I name the EnvironmentConfigurationFile "Web.Config" and try a manual "Save Merged Configuration" from the EntLib Config Tool, it gives an understandable FileInUse error.  And if I rename this Environment.Config, the merge works, but what then?  How do I use this non-standard .Config file without renaming it on each build to each environment?

Nov 5, 2008 at 6:58 AM

I have diffrent application environments: Development, Test, Staging, Production, etc
Currently, I am logging using Database Trace Listner programatically.
Now, I need to load environment specific details (e.g connection string for Development, Test, Staging, Production etc) programatically.
How/Where can i specify environment specific details in my web.config or anywhere else?

Anyone have sample example for above scanerio?