The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
Using XF/UWP, we are successfully using the Windows.Devices.PointOfService.PosPrinting API to connect to network receipt printers.
The PosPrinter.FromIdAsync() call will popup a dialog for the user to confirm they wish to pair with the printer. From there we claim the printer, enable, and send it a print job.
Using MAUI/WinUI3, the same code with the same 'pointOfService' capability set in the manifest returns null almost instantly. No dialog is shown. I know the printer is available because I retrieved the ID using:
...and I can of course run the UWP version side by side and successfully get the PosPrinter handle using the same ID once I have confirmed using the pairing dialog.
The same happens on a vanilla WinUI3 app without using MAUI.
Steps to reproduce the bug
1) Ensure a POS printer (such as Epson TM-M30) is connected to the network.
2) Create a blank WinUI3 desktop app.
3) Add PointOfService capability to the manifest.
3) Add this method to MainWindow.xaml.cs and call PosPrinting() in the myButton_Click listener.
Successfully retrieve a PosPrinter object using PosPrinter.FromIdAsync(deviceInfo.Id). If first attempt to connect to the PosPrinter, first show a dialog for the user to confirm pairing.
Describe the bug
Using XF/UWP, we are successfully using the Windows.Devices.PointOfService.PosPrinting API to connect to network receipt printers.
The PosPrinter.FromIdAsync() call will popup a dialog for the user to confirm they wish to pair with the printer. From there we claim the printer, enable, and send it a print job.
Using MAUI/WinUI3, the same code with the same 'pointOfService' capability set in the manifest returns null almost instantly. No dialog is shown. I know the printer is available because I retrieved the ID using:
DeviceInformation.FindAllAsync(PosPrinter.GetDeviceSelector(PosConnectionTypes.IP));
...and I can of course run the UWP version side by side and successfully get the PosPrinter handle using the same ID once I have confirmed using the pairing dialog.
The same happens on a vanilla WinUI3 app without using MAUI.
Steps to reproduce the bug
1) Ensure a POS printer (such as Epson TM-M30) is connected to the network. 2) Create a blank WinUI3 desktop app. 3) Add PointOfService capability to the manifest. 3) Add this method to MainWindow.xaml.cs and call PosPrinting() in the myButton_Click listener.
p will be null.
Expected behavior
Successfully retrieve a PosPrinter object using PosPrinter.FromIdAsync(deviceInfo.Id). If first attempt to connect to the PosPrinter, first show a dialog for the user to confirm pairing.
Screenshots
NuGet package version
No response
Windows app type
Device form factor
Desktop
Windows version
Windows 11 (21H2): Build 22000
Additional context
Microsoft.WindowsAppSDK versions is
1.1.3 1.2.2.220902.1.-preview1