Hi,
As suggested on msdn social forum, http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/ab59671a-f0a3-4182-ba5b-7fa17f0a6118?prof=required
I turned off the the Visual Studio hosting process and verified that the changes are saved to MyApp.exe.config file instead of MyApp.vhost.exe.config file when still running under Debug configuration. However when I deployed my application with Release configuration to C:\UAT\MyApp\, it would not save the changes to C:\UAT\MyApp\Application Files\MyAPP_1_0_0_0\MyApp.exe.config file. I checked file permissions and made sure that ReadOnly is not checked for MyApp.exe.config file.
In addition, I also tried to SaveAs(persist\MyApp_yyyymmdd.config). While running in Debug mode inside Visual Studio 2008 (vhosting turned off), it does create 'persist' folder under bin/Debug and saves the file there. However the deployed version in C:\UAT\MyApp\ does not create such folder. I made sure all folders under C:\UAT are not set to ReadOnly.
I am using Visual Studio 2008. Appreciate any help on this.
Follow up: I also made sure that Security was set to 'This is a full trust application' from Project Properties before deploying the application.