【问题标题】:Working with Web.Release.config (Web.config transformation)使用 Web.Release.config(Web.config 转换)
【发布时间】:2011-12-02 14:07:46
【问题描述】:

在我的 Web.config 文件中有以下设置:

<add key="ClientMail" value="ridermansb@bindsolution.com"/>

在我的文件中,我是 Web.Release.config:

<appSettings>
    <add key="ClientMail"
                xdt:Transform="SetAttributes"
                xdt:Locator="Match(value)"
                value="ridermansb@gmail.com"/>
</appSettings>

在发布模式下运行站点时,如何在 Web.Release.config 中应用设置?

在这种情况下,我需要更改 &lt;appSettings&gt; 中的设置值

【问题讨论】:

    标签: asp.net-mvc-3 web-config transform configuration-files transformation


    【解决方案1】:

    我相信这仅适用于发布版本。否则,您需要包含构建事件以在配置构建中合并命名构建配置。如果您对此感兴趣,请告诉我,我会在此处找到我的帖子。

    在此处了解 Web 配置转换:http://weblogs.asp.net/gunnarpeipman/archive/2009/06/16/visual-studio-2010-web-config-transforms.aspx

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-31
    • 2012-05-08
    • 2011-04-07
    • 1970-01-01
    • 1970-01-01
    • 2011-10-23
    • 2012-05-02
    相关资源
    最近更新 更多