Skip to content

Toast notification from c++ app #3861

Closed
@ivan2007

Description

@ivan2007

Hi,
I have the following setup
c++ win32 app -> c++/cli netcore 3.1 -> wpf netcore 3.1

I am trying to send a toast notification from the wpf module but I get this exception
image

In my case Assembly.GetEntryAssembly() is always null but the code inside GetDisplayNameFromCurrentProcess doesn't manage it:
private static string GetDisplayNameFromCurrentProcess(Process process) { AssemblyTitleAttribute customAttribute = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyTitleAttribute>(); if (customAttribute != null) return customAttribute.Title; return process.ProcessName; }

Activity

added
bug 🐛An unexpected issue that highlights incorrect behavior
on Mar 18, 2021
ghost

ghost commented on Mar 18, 2021

@ghost

Hello ivan2007, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

added this to the 7.0.1 milestone on Mar 18, 2021
michael-hawker

michael-hawker commented on Mar 18, 2021

@michael-hawker
Member
self-assigned this
on Mar 18, 2021
andrewleader

andrewleader commented on Mar 18, 2021

@andrewleader
Contributor

Hey @ivan2007 thanks for reporting this! Seems like handling the null case will fix it, I opened a super simple PR addressing that: #3866

Are you able to verify by referencing the toolkit locally in that branch to test and verify that this all works as expected in your scenario after that change? Even if you can't thank you regardless for reporting this!!

ivan2007

ivan2007 commented on Mar 18, 2021

@ivan2007
Author

Hey @andrewleader,
I have recompiled the package with the super simple fix and all works great in my scenario.
Thank you

ivan2007

ivan2007 commented on Mar 18, 2021

@ivan2007
Author

I have another open issue CommunityToolkit/Microsoft.Toolkit.Win32#306 (comment) but nobody gave me a response. Can you take a look? Thank you

ghost closed this as completedin #3866on Mar 22, 2021
ghost added a commit that references this issue on Mar 22, 2021
cf29259
ghost locked as resolved and limited conversation to collaborators on May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @andrewleader@ivan2007@michael-hawker

    Issue actions

      Toast notification from c++ app · Issue #3861 · CommunityToolkit/WindowsCommunityToolkit