Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scriptcs -repl
- #r "System.Xml.Linq"
- using System.Xml.Linq;
- XDocument doc = XDocument.Load("app.config");
- var result = doc.Element("configuration")
- .Element("connectionStrings")
- .Elements("add")
- .Single(el => el.Attribute("name").Value == "MongoDB");
- result.SetAttributeValue("connectionString", "mongodb://%deploy.DatabaseHost%:%deploy.DatabasePort%/%deploy.DatabaseName%");
- doc.Save("app.config");
- Environment.Exit(0);
- echo.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement