app.config transformations not applying

落花浮王杯 提交于 2020-01-06 08:21:03

问题


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

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

<?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>

回答1:


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



来源:https://stackoverflow.com/questions/21517602/app-config-transformations-not-applying

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!