Unable to connect to any of my industrial usb3 cameras in winui3 C#

Scott Alexander 0 Reputation points
2025-02-26T14:37:09.6733333+00:00

We are porting our UI from Win Forms/WPF to WinUI3 C#. My classes to connect and control industrial cameras like Basler and IDS usb3 versions work as expected in WPF. But I am unable to connect to them when using WinUI3. All of the problems (the errors aren't the same) seem related to threading. I converted my camera class to .Net Standard 2.0. That made no change (works on WPF fails on WinUI3).

This is errors from my Immediate Window:

Exception thrown: 'System.Runtime.InteropServices.SEHException' in Basler.Pylon.dll

Exception thrown: 'System.Runtime.InteropServices.SEHException' in Basler.Pylon.dll

Exception thrown: 'System.Runtime.InteropServices.SEHException' in Basler.Pylon.dll

Basler.Pylon

External component has thrown an exception.

   at Pylon.CDeviceInfo.{ctor}(CDeviceInfo*)

   at Basler.Pylon.Camera..ctor()

   at Detectors.Camera_Basler_USB3.Connect()

I have updated to the latest drivers for both Basler and IDS.

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
830 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.