Coder Social home page Coder Social logo

Question - .net5 about desktopnotifications HOT 7 CLOSED

pr8x avatar pr8x commented on September 24, 2024
Question - .net5

from desktopnotifications.

Comments (7)

maxkatz6 avatar maxkatz6 commented on September 24, 2024 1

Yes, it's a correct place for questions.

Have you tried to use it? .NET Core 3.1 is compatible with .NET 5.

from desktopnotifications.

pld32 avatar pld32 commented on September 24, 2024

I just tried and getting some errors in DesktopNotifications.Windows WindowsNotificationManager.cs.

Attached is the error list.

DeskTopNotificationsErrors.txt

from desktopnotifications.

pr8x avatar pr8x commented on September 24, 2024

Which version of Windows are you on? Can you create a repro?

from desktopnotifications.

maxkatz6 avatar maxkatz6 commented on September 24, 2024

I see. Windows package uses Microsoft.Toolkit.Uwp.Notifications, which uses legacy WinRT COM Interop, which was removed from .NET 5. Not sure if Microsoft.Toolkit.Uwp.Notifications was updated to work with newer CsWinRT COM Interop, but if it does - multitarget for "net5.0;netcoreapp3.1" in this package should work. @pr8x

from desktopnotifications.

pr8x avatar pr8x commented on September 24, 2024

It seems that with .NET 5 I cannot reference Microsoft.Toolkit.Uwp.Notifications anymore but instead have to use their "Target Framework Moniker" (https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/desktop-to-uwp-enhance#net-5-use-the-target-framework-moniker-option)

Tried net5.0-windows10.0.17763.0 but that doesn't support some stuff like ToastContentBuilder or ToastNotificationManagerCompat.

EDIT: @maxkatz6 Beat me to it :) Yeah I can probably dual-target here, but I might need to find some replacements for the missing APIs.

from desktopnotifications.

maxkatz6 avatar maxkatz6 commented on September 24, 2024

Related https://blogs.windows.com/windowsdeveloper/2021/03/16/announcing-windows-community-toolkit-v7-0/
And updated https://docs.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/send-local-toast?tabs=uwp

Tried net5.0-windows10.0.17763.0 but that doesn't support some stuff like ToastContentBuilder or ToastNotificationManagerCompat

Yes, something might be missed

from desktopnotifications.

derekantrican avatar derekantrican commented on September 24, 2024

Adding to the convo, I just tried to reference the same library for .NET 5 today and get these build errors:

DesktopNotifications.Windows.dll cannot be referenced because it uses built-in support for WinRT, which is no longer supported in .NET 5 and higher. An updated version of the component supporting .NET 5 is needed. For more information, see https://aka.ms/netsdk1149

Microsoft.Toolkit.Uwp.Notifications.dll cannot be referenced because it uses built-in support for WinRT, which is no longer supported in .NET 5 and higher. An updated version of the component supporting .NET 5 is needed. For more information, see https://aka.ms/netsdk1149

from desktopnotifications.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.