Closed
Description
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
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
ghost commentedon Mar 18, 2021
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 🙌
michael-hawker commentedon Mar 18, 2021
FYI @andrewleader
andrewleader commentedon Mar 18, 2021
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 commentedon Mar 18, 2021
Hey @andrewleader,
I have recompiled the package with the super simple fix and all works great in my scenario.
Thank you
ivan2007 commentedon Mar 18, 2021
I have another open issue CommunityToolkit/Microsoft.Toolkit.Win32#306 (comment) but nobody gave me a response. Can you take a look? Thank you
Handle Assembly being null (#3866)