private void SaveConfig() { _logger.Info($"Saving Loader config, actual loader state: [{_configValues.Enabled}]"); string content = BuildConfig(); _logger._Debug($"Saving config: \n{content}"); try { using (FileStream stream = File.Create(_configFileName)) { byte[] byteContent = new UTF8Encoding(true).GetBytes(content); stream.Write(byteContent, 0, byteContent.Length); } _logger.Info("Loader config saved successfully!"); } catch (Exception e) { _logger.Error("Something went wrong while saving config \n" + e); } }