I am running a c# unit test (VS 2008). Within the test I do write to the settings, which should result in saving the data to the user.config.
Settings.Default.X = "History"; // X is string
Settings.Default.Save();
But this simply does not create the file (I have crosschecked under "C:\Documents and Settings\HW\Local Settings\Application Data").
If I create the same stuff as a Console application, there is no problem persisting the data (same code).
Is there something special I need to consider doing this in a UnitTest?
I tried it with Visual Studio 2010 on Windows 7 and the Visual Studio Unit Test framework is actually creating a temporary folder for test applications in which I found my user.config file with correct settings. I think it might be the same thing on VS 2008. The path scheme to these folder is of the kind:
Windows 10 path:
Windows Vista/Seven path:
Windows XP path:
Good luck.