Fix config location in OptionsLoader

This commit is contained in:
Matt Nadareski
2024-08-08 13:59:21 -04:00
parent cbbb8aaa8c
commit 11b8dd44bb
3 changed files with 9 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
- Fix build for older .NET
- Move two extensions to a better location
- Fix XGD3 SS ranges
- Fix config location in OptionsLoader
### 3.2.1 (2024-08-05)

View File

@@ -1,7 +1,6 @@
using System;
using System.IO;
#if NET40
using System.Threading;
using System.Threading.Tasks;
#endif
using BinaryObjectScanner;

View File

@@ -9,7 +9,14 @@ namespace MPF.Frontend.Tools
{
public static class OptionsLoader
{
private const string ConfigurationPath = "config.json";
/// <summary>
/// Full path to the configuration file used by the program
/// </summary>
#if NET20 || NET35 || NET40 || NET452
private static string ConfigurationPath => Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "config.json");
#else
private static string ConfigurationPath => Path.Combine(AppContext.BaseDirectory, "config.json");
#endif
#region Arguments