Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Could not load ToastNotificationManagerCompat' error on Windows 10 #24

Closed
AhNesh opened this issue Oct 11, 2023 · 2 comments
Closed

'Could not load ToastNotificationManagerCompat' error on Windows 10 #24

AhNesh opened this issue Oct 11, 2023 · 2 comments

Comments

@AhNesh
Copy link

AhNesh commented Oct 11, 2023

When running on Windows 10 I get this error when creating a new WindowsNotificationManager:

DesktopNotifications.Windows.WindowsNotificationManager..ctor(DesktopNotifications.Windows.WindowsApplicationContext ): 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'.

I can find this in the project dependencies

image

@kqr
Copy link

kqr commented Oct 13, 2023

Quoting @pr8x in another issue:

Make sure to target either net6.0-windows10.0.17763.0 or n etcoreapp3.1 in your application. It doesn't wotk with net6.0 unfortunately due to the windows-specific TFM used internally. I will add a note about that in the readme.

This solved that same problem for me.

@AhNesh
Copy link
Author

AhNesh commented Oct 13, 2023

Changing to target net6.0-windows10.0.17763.0 fixed it. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants