如何在构建自动更改连接字符串南特

编程入门 行业动态 更新时间:2024-10-23 04:35:51
本文介绍了如何在构建自动更改连接字符串南特的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是它可以自动更改连接字符串在我的web.config时生成类型为发行采用南特?如果是这样,怎么样?谢谢

is it possible to change the connection string in my web.config automatically when build type is release using Nant? if so, how? thanks

推荐答案

我想你可以使用xmlpoke任务。例如,如果你的web.config是

I think you could use the xmlpoke task. For example, if your web.config is

<?xml version="1.0"?> <configuration> <connectionStrings> <add name="myDb" connectionString="blah" providerName="blah"/> </connectionStrings> </configuration>

然后你可以添加一个任务,这样你的构建文件。

Then you could add a task to your build file like this.

<xmlpoke file="path_to_your_web_root\Web.config" xpath="/configuration/connectionStrings/add[@name='myDb']/@connectionString" value="your_connection_string" />

呵呵,这里是xmlpoke任务的文档。 nant.sourceforge/release/latest/help/tasks/xmlpoke.html

更多推荐

如何在构建自动更改连接字符串南特

本文发布于:2023-10-30 22:46:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1544218.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:南特   字符串   如何在

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!