在发布期间,我试图在生产服务器上更新我的连接字符串值。我正在尝试以下方法,但没有结果:
<connectionStrings>
add name="DataConnect" connectionString="Server=Pepe;Database=Oyeti;Integrated Security=SSPI;" xdt:Transform="Replace" />
还添加了xdt:Locator,但我不认为这是正确的方法:
<connectionStrings>
add name="DataConnect" connectionString="Server=Pepe;Database=Oyeti;Integrated Security=SSPI;" xdt:Transform="Replace" xdt:Locator="Match(name)" />
我在那里看不到什么?
谢谢!
发布于 2018-11-28 14:52:57
您可以将xdt:Transform="SetAttributes" xdt:Locator="Match(name)属性添加到转换文件(Web.Release.config)中的connectionString标记中,以转换主配置文件(Web.config)中的值。作为替代,还可以在发布配置文件中指定连接字符串。
虽然默认转换文件包含一个示例,演示如何更新连接字符串,但在大多数情况下,您不需要设置连接字符串转换,因为可以在发布配置文件中指定连接字符串。您将在“部署到IIS”和“部署到生产教程”中这样做。
https://stackoverflow.com/questions/53521572
复制相似问题