November 27th, 2012, 10:50 AM
Can I stop Visual Studio 2008 from overwriting my application configuration file?
A colleague wrote an application named "cranesimulator" in C# and Visual Studio 2008 that contains settings in a configuration file. There is a file in the project named "app.config". When the project gets built, that file gets copied into cransesimulator.exe.config in the project output directory.
If I want to change a simulation parameter such as the time rate (say from 1 real second per 1 simulated minute to 1 real second per 10 simulated seconds), I can change cranesimulator.exe.config. But if I have to rebuild the cranesimulator project, app.config gets copied over the top of the exe.config file, and my changes get lost. Is there any way to stop VS 2008 from replacing the exe.config file?
Or is there some way I can change what file the application is looking for? ConfigurationManager.OpenMappedExeConfiguration() seems to do what I want, if I understand the documentation correctly.
Thank you very much.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!