2 Commits

Author SHA1 Message Date
9717e2d6af Fix System.Drawing.Common dependency
- Add System.Drawing.Common explicitly and prevent pruning
- Update other packages
2025-11-24 13:38:18 -05:00
7ace91684c Handle notification icon error until dependency issue gets worked out 2025-11-24 09:54:16 -05:00
3 changed files with 18 additions and 9 deletions

View File

@@ -6,6 +6,7 @@
<UseWindowsForms>false</UseWindowsForms> <UseWindowsForms>false</UseWindowsForms>
<UseWPF>true</UseWPF> <UseWPF>true</UseWPF>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets> <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<RestoreEnablePackagePruning>false</RestoreEnablePackagePruning>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<EnableDefaultApplicationDefinition>false</EnableDefaultApplicationDefinition> <EnableDefaultApplicationDefinition>false</EnableDefaultApplicationDefinition>
@@ -39,23 +40,24 @@
<PackageReference Include="ChrisKaczor.Wpf.Windows.SnappingWindow" Version="1.0.4" /> <PackageReference Include="ChrisKaczor.Wpf.Windows.SnappingWindow" Version="1.0.4" />
<PackageReference Include="Dapper" Version="2.1.66" /> <PackageReference Include="Dapper" Version="2.1.66" />
<PackageReference Include="DebounceThrottle" Version="3.0.1" /> <PackageReference Include="DebounceThrottle" Version="3.0.1" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.3.0" /> <PackageReference Include="H.NotifyIcon.Wpf" Version="2.3.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.12.3" /> <PackageReference Include="HtmlAgilityPack" Version="1.12.4" />
<PackageReference Include="HtmlTextWriter" Version="3.0.2" /> <PackageReference Include="HtmlTextWriter" Version="3.0.2" />
<PackageReference Include="MahApps.Metro" Version="2.4.11" /> <PackageReference Include="MahApps.Metro" Version="2.4.11" />
<PackageReference Include="Microsoft.SqlServer.Compact" Version="4.0.8876.1" GeneratePathProperty="true"> <PackageReference Include="Microsoft.SqlServer.Compact" Version="4.0.8876.1" GeneratePathProperty="true">
<NoWarn>NU1701</NoWarn> <NoWarn>NU1701</NoWarn>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="9.0.9" /> <PackageReference Include="Microsoft.Windows.Compatibility" Version="10.0.0" />
<PackageReference Include="NameBasedGrid" Version="1.0.0"> <PackageReference Include="NameBasedGrid" Version="1.0.0">
<NoWarn>NU1701</NoWarn> <NoWarn>NU1701</NoWarn>
</PackageReference> </PackageReference>
<PackageReference Include="Realm" Version="20.1.0" /> <PackageReference Include="Realm" Version="20.1.0" />
<PackageReference Include="Serilog" Version="4.3.0" /> <PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" /> <PackageReference Include="Serilog.Enrichers.Thread" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" /> <PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="7.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" /> <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Drawing.Common" Version="10.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Resources\Application.ico" /> <Resource Include="Resources\Application.ico" />

View File

@@ -54,9 +54,6 @@ public partial class MainWindow : IDisposable
// Set up the update handler // Set up the update handler
InitializeUpdate(); InitializeUpdate();
// Show the notification icon
NotificationIcon.Initialize(this);
// Load window settings // Load window settings
LoadWindowSettings(); LoadWindowSettings();
@@ -93,6 +90,16 @@ public partial class MainWindow : IDisposable
NewVersionLink.Visibility = Visibility.Visible; NewVersionLink.Visibility = Visibility.Visible;
} }
try
{
// Show the notification icon
NotificationIcon.Initialize(this);
}
catch (Exception e)
{
Log.Logger.Error(e, "");
}
Log.Logger.Information("MainForm creation finished"); Log.Logger.Information("MainForm creation finished");
} }

View File

@@ -19,7 +19,7 @@ internal static class NotificationIcon
_notificationIcon = new TaskbarIcon { Icon = Resources.Application }; _notificationIcon = new TaskbarIcon { Icon = Resources.Application };
_notificationIcon.TrayMouseDoubleClick += HandleNotificationIconDoubleClick; _notificationIcon.TrayMouseDoubleClick += HandleNotificationIconDoubleClick;
// Setup the menu // Set up the menu
var contextMenu = new ContextMenu(); var contextMenu = new ContextMenu();
contextMenu.Opened += HandleContextMenuOpened; contextMenu.Opened += HandleContextMenuOpened;
@@ -76,7 +76,7 @@ internal static class NotificationIcon
public static void Dispose() public static void Dispose()
{ {
// Get rid of the icon // Get rid of the icon
_notificationIcon.Dispose(); _notificationIcon?.Dispose();
_notificationIcon = null; _notificationIcon = null;
_mainWindow = null; _mainWindow = null;