internal static async Task <RuntimeComposition> TryCreateRuntimeCompositionFromCache(Caching caching) { var cacheManager = new CachedComposition(); try { using (var cacheStream = caching.OpenCacheStream()) { return(await cacheManager.LoadRuntimeCompositionAsync(cacheStream, StandardResolver)); } } catch (Exception ex) { LoggingService.LogError("Could not deserialize MEF cache", ex); caching.DeleteFiles(); } return(null); }