.net - Small tool to edit app settings -
i need small tool in windows environment change entry in appsettings.config
.
it can cmd tool can write batch file on it.
does have clue? thanks
use xmlstarlet. :) npocmaka
updates:
here period of code wrote use xmlstarlet.
to change file:
../bin/config/%~1/appsettings.config
<appsettings> <add key="killmobileservice" value="0"> </appsetting>
to
<appsettings> <add key="killmobileservice" value="1"> </appsetting>
use
xml edit --pf --inplace --update "/appsettings/add[@key='killmobileservice']"/@value -v 1 ../bin/config/%~1/appsettings.config xml fo -t ../bin/config/%~1/appsettings.config >../bin/config/%~1/appsettings_new.config del "..\bin\config\%~1\appsettings.config" ren "..\bin\config\%~1\appsettings_new.config" "appsettings.config"
i use edit , format command. iis restart when detecting content change.
doc link edit command: http://xmlstar.sourceforge.net/doc/ug/ch04s03.html
doc link format command: http://xmlstar.sourceforge.net/doc/ug/ch04s05.html
problem solved. =w=
Comments
Post a Comment