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

ToastNotification run as admin will exception #4914

Open
1 of 14 tasks
YiChunLin105062518 opened this issue Jul 28, 2023 · 4 comments
Open
1 of 14 tasks

ToastNotification run as admin will exception #4914

YiChunLin105062518 opened this issue Jul 28, 2023 · 4 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior notifications 🔔

Comments

@YiChunLin105062518
Copy link

Describe the bug

In the standard user account, run app as admin, the app execution identity will be admin, resulting access is denied when prompt notification.

Regression

No response

Reproducible in sample app?

  • This bug can be reproduced in the sample app.

Steps to reproduce

1.loggin standard user account
2.run app as admin
3.the app call show toast:
new ToastContentBuilder()
.AddText(title)
.AddText(mag)
.Show();
4.toast not show and thrown exception:
[Exception in LogUnhandledException] exception: System.UnauthorizedAccessException: Access is denied. (0x80070005 (E_ACCESSDENIED))
   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Windows.UI.Notifications.IToastNotifierMethods.Show(IObjectReference _obj, ToastNotification notification)
   at Windows.UI.Notifications.ToastNotifier.Show(ToastNotification notification)
   at Microsoft.Toolkit.Uwp.Notifications.ToastNotifierCompat.Show(ToastNotification notification)
   at Microsoft.Toolkit.Uwp.Notifications.ToastContentBuilder.Show(CustomizeToast customize)
   at XXX.ToastHandler.<>c_DisplayClass11_0.<ShowToast>b_0()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Expected behavior

notification to be prompted under the standard user account.

Screenshots

No response

Windows Build Number

  • Windows 10 1809 (Build 17763)
  • Windows 10 1903 (Build 18362)
  • Windows 10 1909 (Build 18363)
  • Windows 10 2004 (Build 19041)
  • Windows 10 20H2 (Build 19042)
  • Windows 10 21H1 (Build 19043)
  • Windows 11 21H2 (Build 22000)
  • Other (specify)

Other Windows Build number

Windows 11 (22H2)

App minimum and target SDK version

  • Windows 10, version 1809 (Build 17763)
  • Windows 10, version 1903 (Build 18362)
  • Windows 10, version 1909 (Build 18363)
  • Windows 10, version 2004 (Build 19041)
  • Other (specify)

Other SDK version

No response

Visual Studio Version

No response

Visual Studio Build Number

Microsoft Visual Studio Professional 2022 (64 bit) - Current version 17.5.4

Device form factor

Desktop

Nuget packages

Microsoft.Toolkit.Uwp.Notifications 7.1.2, 7.1.3

Additional context

No response

Help us help you

No.

@YiChunLin105062518 YiChunLin105062518 added the bug 🐛 An unexpected issue that highlights incorrect behavior label Jul 28, 2023
@ghost ghost added the needs triage 🔍 label Jul 28, 2023
@ghost
Copy link

ghost commented Jul 28, 2023

Hello YiChunLin105062518, 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 🙌

@GitUser200607
Copy link

GitUser200607 commented Aug 2, 2023

I've got the same error when running it using UAC.
I think, the problem is the app trying to sent Toast notification to other account, not currently interactive one.

@GitUser200607
Copy link

@ghost ghost added the needs attention 👋 label Aug 26, 2023
@ghost
Copy link

ghost commented Aug 26, 2023

This issue has been marked as "needs attention 👋" due to no activity for 15 days. Please triage the issue so the fix can be established.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior notifications 🔔
Projects
None yet
Development

No branches or pull requests

3 participants