diff --git a/src/D2L.Bmx/Program.cs b/src/D2L.Bmx/Program.cs index 8216f2ba..6a4fc9f4 100644 --- a/src/D2L.Bmx/Program.cs +++ b/src/D2L.Bmx/Program.cs @@ -217,10 +217,14 @@ await UpdateChecker.CheckForUpdatesAsync( configProvider.GetConfiguration() ); //Creating new Cache directory and removing old files. if( !Directory.Exists( BmxPaths.CACHE_DIR ) ) { - Directory.CreateDirectory( BmxPaths.CACHE_DIR ); - File.Delete( Path.Join( BmxPaths.BMX_DIR, "awsCredsCache" ) ); - File.Delete( Path.Join( BmxPaths.BMX_DIR, "sessions" ) ); - File.Delete( Path.Join( BmxPaths.BMX_DIR, "update_check" ) ); + try { + Directory.CreateDirectory( BmxPaths.CACHE_DIR ); + File.Delete( Path.Join( BmxPaths.BMX_DIR, "awsCredsCache" ) ); + File.Delete( Path.Join( BmxPaths.BMX_DIR, "sessions" ) ); + File.Delete( Path.Join( BmxPaths.BMX_DIR, "update_check" ) ); + } catch ( Exception ex ) { + Console.WriteLine( "Error cleaning up old files continuing..." ); + } } await next( context ); },