asp.net - 如何在我的 web.config.release 中转换这部分 webconfig?

标签 asp.net web-config xslt

我需要在 web.config 转换中更改 SMTP 主机值。这是我所拥有的:

<system.net>
    <mailSettings>
      <smtp from="some@sioem.com">
        <network host="localhost" userName="" password=""/>
      </smtp>
    </mailSettings>
  </system.net>

我应该如何将它放在 web.release.config 中,而不是 localhost 它说 192.168.1.9 ?

我像这样转换连接字符串,但不确定如何使用 smtp 进行转换

<connectionStrings>
  <add name="CoreModelContext"
    connectionString="metadata=&&quot;" providerName="System.Data.EntityClient"
    xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>

最佳答案

<system.net>
  <mailSettings>
    <smtp>
      <network xdt:Transform="Replace" host="192.168.1.9" userName="" password="" />
    </smtp>
  </mailSettings>
</system.net>

关于asp.net - 如何在我的 web.config.release 中转换这部分 webconfig?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6381346/

相关文章:

c# - 使用 ASP.NET MVC 中父页面模型的内容填充 PartialView 模型

mysql - 用户 'abc1234' @'WIN-TQV06J8SPLP' 的访问被拒绝(使用密码 : YES)]

c# - 在 XSLT 中迭代

html - 使用字符串长度条件将 XSLT 中的 XML 转换为 HTML

c# - 尝试了解 "Common"与 ASP.NET 和 HttpClient() 的异步死锁

c# - 如何在循环期间更改字典的值

javascript - 使用 JavaScript 启用/禁用单选按钮列表

asp.net - web.config 是否比数据库更安全?

asp.net - 加密 Web.config 并安装

xslt - 如何在 XSLT 选择中执行 'and' 语句?