From c935ad3482a36b0e30d15720fe07631ebf58382d Mon Sep 17 00:00:00 2001 From: Taras Petruk Date: Tue, 24 Nov 2020 18:32:55 +0200 Subject: [PATCH] Fix crash in unit tests when initializing UpdateManager (win) --- .../TogglDesktop/TogglDesktop/Services/UpdateService.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/windows/TogglDesktop/TogglDesktop/Services/UpdateService.cs b/src/ui/windows/TogglDesktop/TogglDesktop/Services/UpdateService.cs index 2580eb0bce..b84b84498e 100644 --- a/src/ui/windows/TogglDesktop/TogglDesktop/Services/UpdateService.cs +++ b/src/ui/windows/TogglDesktop/TogglDesktop/Services/UpdateService.cs @@ -5,9 +5,11 @@ using System.Reactive.Linq; using System.Reactive.Subjects; using System.Reactive.Threading.Tasks; +using System.Reflection; using System.Threading.Tasks; using Onova; using Onova.Exceptions; +using Onova.Models; using Onova.Services; namespace TogglDesktop.Services @@ -21,6 +23,7 @@ public UpdateService(bool isUpdateCheckDisabled, string updatesPath) { IsUpdateCheckEnabled = !isUpdateCheckDisabled; _updateManager = new UpdateManager( + AssemblyMetadata.FromAssembly(Assembly.GetEntryAssembly() ?? Assembly.GetAssembly(typeof(UpdateService))), new LocalPackageResolver(updatesPath, "TogglDesktopInstaller*.exe"), new NsisPackageExtractor());