VariablePlaceholderConfigurer取决于构建配置文件

时间:2014-07-02 07:56:17

标签: c# spring visual-studio visual-studio-2013 spring.net

我们使用VariablePlaceholderConfigurer来定义例如db-connection,...

<object name="appConfigPropertyHolder"
      type="Spring.Objects.Factory.Config.VariablePlaceholderConfigurer, Spring.Core">
<property name="VariableSources">
  <list>
    <object type="Spring.Objects.Factory.Config.PropertyFileVariableSource, Spring.Core">
      <property name="Location"
                value="~\Config\Spring.Properties.config" />
    </object>
  </list>
</property>
</object>       

<db:provider id="projectCockpitDbProvider"
           provider="${dbProvider}"
           connectionString="${dbConnectionString}" />

有没有办法根据构建配置文件定义属性文件?

这样的东西
<property name="Location" 
          value="~\Config\Spring.Properties.{$BuildProfile}.config" />

<property name="Location" condition="[Buildprofile]"
          value="~\Config\Spring.Properties.config" />

有人有任何想法吗?

0 个答案:

没有答案