web.config
<connectionStrings configBuilders="CS_Environment">
<add name="connectionA" connectionString="EnvVarA" providerName="System.Data.SqlClient"/>
<add name="connectionB" connectionString="EnvVarB" providerName="System.Data.EntityClient"/>
</connectionStrings>
The ConnectionStringSettings
object's ProviderName
will be an empty string instead of "System.Data.SqlClient"
or "System.Data.EntityClient"
.
The Name
and ConnectionString
properties map just fine. If I remove the configBuilders
attribute from the tag, the provider name will be populated. Of course, the correct environment variable no longer will be fetched but the point is the configBuilder is breaking this.
Here is the configuration builder being used for the connection strings:
<add name="CS_Environment" mode="Greedy" prefix="ConnStr_" stripPrefix="true"
type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder,
Microsoft.Configuration.ConfigurationBuilders.Environment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />