In my application I start a process through my code with app.config using following code
Process proc = Process.Start(@"c:\windows\system32\notepad.exe");
Than I have to change app.config file two or three times while running it. I am wondering how to do it so I dont need to stop and change the app.config file and than re start the process.
I have following code that I saw in another post.
// Load the app.config file
XmlDocument xml = new XmlDocument();
xml.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
// Do whatever you need, like modifying the appSettings section
// Save the new setting
xml.Save(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
I am wondering if last line where it saves the new setting that is being done while the process is still running? or process needs to be re started? My goal is where I dont need to keep restarting the process. Thanks