【发布时间】:2013-06-08 20:00:37
【问题描述】:
我的 web.config 中有这个
<add name="AS400" connectionString="Provider=IBMDA400;Data Source=AAAAA;User Id=aaaaaa;Password=aaaaaa;Default Collection=*SYS;" providerName="System.Data.OleDb" lockItem="true"/>
在我的 Web.Debug.config 中(与 Webconfig 相同)
<add name="AS400" connectionString="Provider=IBMDA400;Data Source=AAAAA;User Id=aaaaaa;Password=aaaaaa;Default Collection=*SYS;" providerName="System.Data.OleDb" lockItem="true" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
在我的 Web.Release.config 中
<add name="AS400" connectionString="Provider=IBMDA400;Data Source=ZZZZZ;User Id=aaaaaa;Password=aaaaaa;Default Collection=*SYS;" providerName="System.Data.OleDb" lockItem="true" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
但没有任何效果。如果我在发布模式下按 F5,我总是在 web.config 中有连接字符串。
一个想法?
【问题讨论】:
-
如果你在文件上右击-> 预览转换是否有效?
-
我相信这不是调试和发布配置的工作方式。它们仅在您进行发布时才转换,而不是在 Visual Studio 中进行调试时转换。我会看看是否能找到来自 Microsoft 的文章。
标签: c# debugging web-config connection-string release