c# Unit Test: Writing to Settings in unit test does not save values in user.config

Posted by HorstWalter on Stack Overflow See other posts from Stack Overflow or by HorstWalter
Published on 2010-04-22T23:05:17Z Indexed on 2010/04/22 23:33 UTC
Read the original article Hit count: 475

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET