Created
April 8, 2013 14:51
-
-
Save sitereactor/5337369 to your computer and use it in GitHub Desktop.
Updates the DefaultRenderingEngine in the umbracoSettings.config file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UpdateRenderingEngineToMvc() | |
{ | |
//Local variables | |
var path = GlobalSettings.FullpathToRoot + Path.DirectorySeparatorChar + "config" + Path.DirectorySeparatorChar; | |
var filePath = path + "umbracoSettings.config"; | |
var value = RenderingEngine.Mvc; | |
//Load the config file as xml | |
var xml = new XmlDocument(); | |
var settingsReader = new XmlTextReader(filePath); | |
xml.Load(settingsReader); | |
//Find the correct node for the 'defaultRenderingEngine' and update the value | |
var node = xml.DocumentElement.SelectSingleNode("/settings/templates/defaultRenderingEngine"); | |
node.InnerText = value.ToString(); | |
xml.Save(filePath); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment