加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net-mvc-3 – 使用Web.Release.config(Web.config转换)

发布时间:2020-12-16 07:04:02 所属栏目:asp.Net 来源:网络整理
导读:在我的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@g
在我的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中应用这些设置?

在这种情况下,我需要在< appSettings>中更改设置的值

解决方法

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读