diff --git a/src/IPA.Bcfier/Services/SettingsService.cs b/src/IPA.Bcfier/Services/SettingsService.cs index 7bf39dc7..2d13a4e4 100644 --- a/src/IPA.Bcfier/Services/SettingsService.cs +++ b/src/IPA.Bcfier/Services/SettingsService.cs @@ -38,7 +38,13 @@ public async Task LoadSettingsAsync() public async Task SaveSettingsAsync(Settings settings) { var serializedSettings = JsonConvert.SerializeObject(settings); - using var settingsFileStream = File.OpenWrite(GetPathToSettingsFile()); + var settingsFilePath = GetPathToSettingsFile(); + if (File.Exists(settingsFilePath)) + { + File.Delete(settingsFilePath); + } + + using var settingsFileStream = File.Create(settingsFilePath); using var streamWriter = new StreamWriter(settingsFileStream); await streamWriter.WriteAsync(serializedSettings); }