@@ -155,13 +155,13 @@ private static async Task StartAppCenter()
155
155
}
156
156
}
157
157
158
- public static async Task LoadOtherStuffAsync ( )
158
+ private static async Task InitializeAppComponentsAsync ( )
159
159
{
160
160
// Start off a list of tasks we need to run before we can continue startup
161
- await StartAppCenter ( ) ;
162
161
await Task . Run ( async ( ) =>
163
162
{
164
163
await Task . WhenAll (
164
+ StartAppCenter ( ) ,
165
165
DrivesManager . EnumerateDrivesAsync ( ) ,
166
166
CloudDrivesManager . EnumerateDrivesAsync ( ) ,
167
167
LibraryManager . EnumerateLibrariesAsync ( ) ,
@@ -196,13 +196,14 @@ protected override async void OnLaunched(LaunchActivatedEventArgs e)
196
196
{
197
197
await logWriter . InitializeAsync ( "debug.log" ) ;
198
198
Logger . Info ( $ "App launched. Prelaunch: { e . PrelaunchActivated } ") ;
199
-
199
+
200
200
//start tracking app usage
201
201
SystemInformation . Instance . TrackAppUse ( e ) ;
202
202
203
203
bool canEnablePrelaunch = ApiInformation . IsMethodPresent ( "Windows.ApplicationModel.Core.CoreApplication" , "EnablePrelaunch" ) ;
204
204
205
205
await EnsureSettingsAndConfigurationAreBootstrapped ( ) ;
206
+ InitializeAppComponentsAsync ( ) . ContinueWith ( t => Logger . Warn ( t . Exception , "Error during LoadOtherStuffAsync()" ) , TaskContinuationOptions . OnlyOnFaulted ) ;
206
207
207
208
var rootFrame = EnsureWindowIsInitialized ( ) ;
208
209
@@ -260,6 +261,7 @@ protected override async void OnFileActivated(FileActivatedEventArgs e)
260
261
SystemInformation . Instance . TrackAppUse ( e ) ;
261
262
262
263
await EnsureSettingsAndConfigurationAreBootstrapped ( ) ;
264
+ InitializeAppComponentsAsync ( ) . ContinueWith ( t => Logger . Warn ( t . Exception , "Error during LoadOtherStuffAsync()" ) , TaskContinuationOptions . OnlyOnFaulted ) ;
263
265
264
266
var rootFrame = EnsureWindowIsInitialized ( ) ;
265
267
@@ -325,6 +327,7 @@ protected override async void OnActivated(IActivatedEventArgs args)
325
327
Logger . Info ( $ "App activated by { args . Kind . ToString ( ) } ") ;
326
328
327
329
await EnsureSettingsAndConfigurationAreBootstrapped ( ) ;
330
+ InitializeAppComponentsAsync ( ) . ContinueWith ( t => Logger . Warn ( t . Exception , "Error during LoadOtherStuffAsync()" ) , TaskContinuationOptions . OnlyOnFaulted ) ;
328
331
329
332
var rootFrame = EnsureWindowIsInitialized ( ) ;
330
333
0 commit comments