本文介绍了如何在构建自动更改连接字符串南特的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是它可以自动更改连接字符串在我的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
更多推荐
如何在构建自动更改连接字符串南特
发布评论