I am pretty new to C# and wanted to save some settings. My application has to be able to run multiple instances therefore it is a possibility of several simultaneous writes to the user.config
file. Causing the config file to become corrupted. Therefore I wonder if there are any File level locking when they are saved.
Tried to take a look on the source code for .Save
and this seems to be boiling down to the interface call IInternalConfigHost.OpenStreamForWriting
. But it is an interface so I can not easily answer this question on my own.
Updated the wording somewhat.
Basically I am wondering if the user.config file can become corrupt due to several simultaneous writes to it from several instances of my application.