Skip to content

Microsoft.Toolkit.Uwp.Notifications.dll needs to be included in .NET Native runtime directives #3093

@mfeingol

Description

@mfeingol

Describe the bug

When a UWP app is linked using .NET Native and shipped to the store, toast notifications built using Microsoft.Toolkit.Uwp.Notifications.dll stop working. They still appear, but they lose all context provided by the user and show up as:

$AppName
New Notification

The workaround is to include the notifications assembly in rd.xml, like so:

<Assembly Name="Microsoft.Toolkit.Uwp.Notifications" Dynamic="Required All" />

  • Is this bug a regression in the toolkit?

Yes, because this used to work without unnatural acts. But unclear when that was.

Steps to Reproduce

  1. Build a simple app that uses Microsoft.Toolkit.Uwp.Notifications to trigger notifications
  2. Confirm it works
  3. Compile it with .NET Native (debug builds are fine)
  4. Confirm all context is lost in notifications
  5. Add the directive mentioned above. Confirm it works again.

Expected behavior

The Toolkit NuGet package should provide an rd.xml that just works, so apps don't have to figure this out themselves.

cf https://devblogs.microsoft.com/dotnet/net-native-deep-dive-making-your-library-great/

Screenshots

image

Environment

Package Version(s): 6.0.0

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • Insider Build (build number: )

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • Insider Build (xxxxx)

Device form factor:

  • Desktop
  • Xbox
  • Surface Hub
  • IoT

Visual Studio

  • 2017 (version: )
  • 2019 (version: )
  • 2019 (version: 16.4.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions