gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 13:00:28 24 4
gpt4 key购买 nike

我需要在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com