XmlMassUpdate - 替换值节点
我正在尝试使用 XmlMassUpdate 根据构建版本类型更新我的配置文件。 似乎没有关于如何在任何地方更新新的 app.config (vs2008) 设置格式的文档。
这是配置部分:
<applicationSettings>
<CTC.Mica.ClientService.Properties.Settings>
<setting name="PipeName" serializeAs="String">
<value>\\.\pipe\micaPipe</value>
</setting>
<setting name="CTC_Mica_ClientService_MicaWebService_MicaWebService"
serializeAs="String">
<value>URL</value>
</setting>
</CTC.Mica.ClientService.Properties.Settings>
</applicationSettings>
我正在尝试更新此文件中的 URL 值:
<Debug>
<setting xmu:key="name" name="CTC_Mica_ClientService_MicaWebService_MicaWebService" serializeAs="String">
<value>DEVURL</value>
</setting>
</Debug>
<Test>
<setting xmu:key="name" name="CTC_Mica_ClientService_MicaWebService_MicaWebService" serializeAs="String">
<value>TESTURL</value>
</setting>
</Test>
<Release>
<setting xmu:key="name" name="CTC_Mica_ClientService_MicaWebService_MicaWebService" serializeAs="String">
<value>LIVEURL</value>
</setting>
</Release>
运行脚本,我可以替换“name”或“serializeAs”属性,但不能替换值节点。
我将如何更换值节点?
问候
特里斯
I'm trying to use XmlMassUpdate to update my config files based on build Version type. There seems to be no documentation on how to update the new app.config (vs2008) settings formats anywhere.
This is the config section:
<applicationSettings>
<CTC.Mica.ClientService.Properties.Settings>
<setting name="PipeName" serializeAs="String">
<value>\\.\pipe\micaPipe</value>
</setting>
<setting name="CTC_Mica_ClientService_MicaWebService_MicaWebService"
serializeAs="String">
<value>URL</value>
</setting>
</CTC.Mica.ClientService.Properties.Settings>
</applicationSettings>
And i am trying to update the URL value from this file:
<Debug>
<setting xmu:key="name" name="CTC_Mica_ClientService_MicaWebService_MicaWebService" serializeAs="String">
<value>DEVURL</value>
</setting>
</Debug>
<Test>
<setting xmu:key="name" name="CTC_Mica_ClientService_MicaWebService_MicaWebService" serializeAs="String">
<value>TESTURL</value>
</setting>
</Test>
<Release>
<setting xmu:key="name" name="CTC_Mica_ClientService_MicaWebService_MicaWebService" serializeAs="String">
<value>LIVEURL</value>
</setting>
</Release>
Running the script, i can replace either the "name" or the "serializeAs" attributes, but not the value node.
How would i go about replacing the value node?
Regards
Tris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下脚本对我来说工作正常(在 1.3.0.471 上运行,这可能是每晚构建):
build.proj
input.xml
subs.xml
output.xml (由构建生成)
The following scripts work fine for me (running on 1.3.0.471 which might be a nightly build):
build.proj
input.xml
subs.xml
output.xml (generated by build)