diff --git a/src/StatisticsAnalysisTool/EstimatedMarketValue/EstimatedMarketValueController.cs b/src/StatisticsAnalysisTool/EstimatedMarketValue/EstimatedMarketValueController.cs index 1a338b4cf..3df22bd99 100644 --- a/src/StatisticsAnalysisTool/EstimatedMarketValue/EstimatedMarketValueController.cs +++ b/src/StatisticsAnalysisTool/EstimatedMarketValue/EstimatedMarketValueController.cs @@ -132,6 +132,7 @@ public static async Task LoadFromFileAsync() public static async Task SaveInFileAsync() { + DirectoryController.CreateDirectoryWhenNotExists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.UserDataDirectoryName)); await FileController.SaveAsync(_estimatedMarketValueObjects.ToList().Select(EstimatesMarketValueMapping.Mapping), Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.UserDataDirectoryName, Settings.Default.EstimatedMarketValueFileName)); Debug.Print("Estimated market values saved"); diff --git a/src/StatisticsAnalysisTool/Network/Manager/StatisticController.cs b/src/StatisticsAnalysisTool/Network/Manager/StatisticController.cs index 5b6fd5a8d..397a6ef1f 100644 --- a/src/StatisticsAnalysisTool/Network/Manager/StatisticController.cs +++ b/src/StatisticsAnalysisTool/Network/Manager/StatisticController.cs @@ -273,6 +273,7 @@ public async Task LoadFromFileAsync() public async Task SaveInFileAsync() { + DirectoryController.CreateDirectoryWhenNotExists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.UserDataDirectoryName)); await FileController.SaveAsync(_dashboardStatistics, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.UserDataDirectoryName, Settings.Default.StatsFileName)); Debug.Print("Statistics saved"); } diff --git a/src/StatisticsAnalysisTool/Network/Manager/TreasureController.cs b/src/StatisticsAnalysisTool/Network/Manager/TreasureController.cs index d4ac51bc7..0be84ebd9 100644 --- a/src/StatisticsAnalysisTool/Network/Manager/TreasureController.cs +++ b/src/StatisticsAnalysisTool/Network/Manager/TreasureController.cs @@ -292,6 +292,7 @@ public async Task LoadFromFileAsync() public async Task SaveInFileAsync() { + DirectoryController.CreateDirectoryWhenNotExists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.UserDataDirectoryName)); await FileController.SaveAsync(_treasures, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.UserDataDirectoryName, Settings.Default.TreasureStatsFileName)); Debug.Print("Treasure saved"); } diff --git a/src/StatisticsAnalysisTool/Network/Manager/VaultController.cs b/src/StatisticsAnalysisTool/Network/Manager/VaultController.cs index 0716b3031..c1e7fcf51 100644 --- a/src/StatisticsAnalysisTool/Network/Manager/VaultController.cs +++ b/src/StatisticsAnalysisTool/Network/Manager/VaultController.cs @@ -331,6 +331,7 @@ public async Task LoadFromFileAsync() public async Task SaveInFileAsync() { + DirectoryController.CreateDirectoryWhenNotExists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.UserDataDirectoryName)); await FileController.SaveAsync(Vaults, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, Settings.Default.UserDataDirectoryName, Settings.Default.VaultsFileName)); Debug.Print("Vault saved"); }