Hi @Jack , Welcome to Microsoft Q&A,
The error messages System.TypeInitializationException and System.Runtime.InteropServices.COMException (0x80040154): Class not registered indicate that a COM class is not registered, probably because the correct Windows Runtime component is not installed or the corresponding COM object is not registered. This error usually occurs in applications that use WinRT (Windows Runtime) APIs, especially when interacting with system components or specific devices.
You can try to register the COM component manually. For some specific classes, you may need to register the related DLL or EXE.
Open a command prompt (run as administrator) and use the regsvr32 command to register the DLL file:
regsvr32 <path-to-dll>
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.