Fix config access permissions (#671)

This commit is contained in:
Deterous
2024-03-07 16:08:37 +09:00
committed by GitHub
parent 7a928decff
commit 2d142e9e9d
2 changed files with 3 additions and 1 deletions

View File

@@ -15,6 +15,7 @@
- Update packages to latest
- Enable LibIRD for all .NET frameworks (Deterous)
- Try updating PR check action
- Fix config access persmission (Deterous)
### 3.1.2 (2024-02-27)

View File

@@ -272,7 +272,8 @@ namespace MPF.Core.Utilities
}
var serializer = JsonSerializer.Create();
var reader = new StreamReader(ConfigurationPath);
var stream = File.Open(ConfigurationPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
var reader = new StreamReader(stream);
var settings = serializer.Deserialize(reader, typeof(Dictionary<string, string?>)) as Dictionary<string, string?>;
return new Options(settings);
}