WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

Calling PrintManagerInterop.ShowPrintUIForWindowAsync() fails if app is run elevated

Open DHancock opened this issue 3 years ago • 1 comments

Describe the bug

The following occurs when calling ShowPrintUIForWindowAsync() from an elevated app:

  1. The print dialog is shown initially.
  2. A fraction of a second later it's closed without any user interaction.
  3. Exactly 30 seconds later a COMException is thrown.

The exception is:

Type: System.Runtime.InteropServices.COMException Message: OLE has sent a request and is waiting for a reply. (0x80010115)

0x80010115 is RPC_S_CALLPENDING The exception stack trace doesn't provide any extra info.

Steps to reproduce the bug

  1. Download provided MS demo code from https://github.com/marb2000/PrintSample
  2. Update project's WinAppSdk nuget package to the latest
  3. Build and deploy packaged target
  4. Right click app in start menu and select run as administrator
  5. Attempt to print

Expected behavior

No response

Screenshots

No response

NuGet package version

Windows App SDK 1.2.2

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

May be similar to the problems that the file pickers have when running elevated #2504

DHancock avatar Dec 31 '22 17:12 DHancock

same as:

  1. https://github.com/microsoft/WindowsAppSDK/issues/2504.

  2. https://github.com/microsoft/WindowsAppSDK/issues/5162.

  3. https://github.com/microsoft/WindowsAppSDK/issues/5167.

mominshaikhdevs avatar Jun 18 '25 13:06 mominshaikhdevs