Hello, I started playing with the Entlib's Environment Overrides feature a few days ago, but I can't get the configuration merging to work. I made a simple example, I set a property named NumberOfChannels in the AppSettings section, created a Production environment an then override the value of the property for that envoronment.
Here is my App.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<appSettings>
<add key="NumberOfChannels" value="3" />
</appSettings>
</configuration>
This is the production environment delta file:
<configuration>
<configSections>
<section name="EnvironmentMergeData" type="Microsoft.Practices.EnterpriseLibrary.Configuration.EnvironmentalOverrides.Configuration.EnvironmentMergeSection, Microsoft.Practices.EnterpriseLibrary.Configuration.EnvironmentalOverrides, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<EnvironmentMergeData environmentName="Production" environmentDeltaFile="Production.config">
<mergeElements>
<override nodePath="vironmentoverridestest\app.config/Application Settings/NumberOfChannels"
overrideProperties="true">
<overridddenProperties>
<add name="Value" value="50" />
</overridddenProperties>
</override>
</mergeElements>
</EnvironmentMergeData>
</configuration>
Finally, this is the merged Configuration.config file, which I obtained through the "Save Merged Configuration" context menu item in the Entlib configuration editor:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<appSettings>
<add key="NumberOfChannels" value="3" />
</appSettings>
</configuration>
As can be seen, the NumberOfChannels property is still 3 in the merged file, instead of 50 as expected.
Hope anyone can help. Thanks,
Sole