【问题标题】:Web.config - T4 Transformation - SMTP sectionWeb.config - T4 转换 - SMTP 部分
【发布时间】:2015-09-03 15:06:44
【问题描述】:

大家好,我正在尝试对 Web 配置文件的 SMTP 部分进行转换。

这是我目前得到的:

<mailSettings>
  <smtp>
    <network host="smtp.sendgrid.net" port="25" userName="UserName1Here" password="Password1Here" defaultCredentials="false" />
  </smtp>
</mailSettings>

然后在 Webconfig 的 .production 版本中我有这个:

<mailSettings>
<smtp xdt:Transform="Replace">
  <network host="smtp.sendgrid.net" port="25" userName="UserName2Here" password="Password2Here" defaultCredentials="false" />
</smtp>

似乎无法让它工作......我错过了什么想法?

【问题讨论】:

    标签: asp.net web-config web-config-transform


    【解决方案1】:

    修复它...

    我缺少的是 web-config 文件的路由元素。 这是

    <system.net>
    

    所以现在可以了

     <system.net>
    <mailSettings>
      <smtp xdt:Transform="Replace">
        <network host="smtp.sendgrid.net" port="25" userName="UserName2Here" password="password2here" defaultCredentials="false" />
      </smtp>
    </mailSettings>
    

    希望这对其他人有所帮助。

    【讨论】:

      猜你喜欢
      • 2016-12-10
      • 2023-04-08
      • 1970-01-01
      • 2011-06-17
      • 1970-01-01
      • 2013-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多