pr8x / DesktopNotifications

A cross-platform C# library for native desktop "toast" notifications.
MIT License
176 stars 27 forks source link

System.TypeLoadException: 'Could not load type 'Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat' from assembly 'Microsoft.Toolkit.Uwp.Notifications #27

Open sn4k3 opened 5 months ago

sn4k3 commented 5 months ago

Using latest nuget in Avalonia raises:

manager = new WindowsNotificationManager(context);

System.TypeLoadException: 'Could not load type 'Microsoft.Toolkit.Uwp.Notifications.ToastNotificationManagerCompat' from assembly 'Microsoft.Toolkit.Uwp.Notifications, Version=7.1.0.0, Culture=neutral, PublicKeyToken=4aff67a105548ee2'.'

image

All nuget installed:

image

Using net6.0, when publishing with net6.0 win-x64 does the same result.

FaBjE commented 3 months ago

I had the same issue. Setting the TargetOS to 10.0.17763.0 fixed it for me (.NET8)

Solution based on this issue: https://github.com/pr8x/DesktopNotifications/issues/24