app.config转换不适用 [英] app.config transformations not applying

查看:223
本文介绍了app.config转换不适用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用SlowCheeta在应用程序发布时,我有一个app.config转换问题。它总是使用dbTable,而不是dbTableLive。

I'm having an issue with app.config transformations using SlowCheeta not applying on publish. It always uses dbTable, not dbTableLive.

app.config

app.config

  <connectionStrings>
    <add name="db2" connectionString="metadata=res://*/db2.csdl|res://*/db2.ssdl|res://*/db2.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=server;initial catalog=db2Table;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
    <add name="db"
         connectionString="metadata=res://*/db.csdl|res://*/db.ssdl|res://*/db.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=server;initial catalog=dbTable;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework&quot;" 
         providerName="System.Data.EntityClient"/>
  </connectionStrings>

app.release.config

app.release.config

<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations 
     see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <connectionStrings >
    <add name="db"
         connectionString="metadata=res://*/db.csdl|res://*/db.ssdl|res://*/db.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=server;initial catalog=dbTableLive;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework&quot;"
         providerName="System.Data.EntityClient"
         xdt:Transform="Replace"
         xdt:Locator="Match(name)"/>
  </connectionStrings>
</configuration>


推荐答案

问题是我没有更改配置在发布项目之前发布。

The issue was that I hadn't changed the configuration to "Release" prior to publishing the project.

这篇关于app.config转换不适用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆