DubyaDude / WindowsMediaController

Allows developers to more easily get information from and interact with the Windows 10/11 OS media interface. (Also referred to Windows System Media Transport Controls (SMTC))
https://nuget.org/packages/Dubya.WindowsMediaController
MIT License
129 stars 9 forks source link

RPC_E_CALL_CANCELED when mediaManager Start or StartAsync #15

Closed KRtekTM closed 1 year ago

KRtekTM commented 1 year ago

Hello,

I'm getting this error when trying to call Start or StartAsync on MediaManager. System.Exception: 'Call was canceled by the message filter. (Exception from HRESULT: 0x80010002 (RPC_E_CALL_CANCELED))'

Once I was able to trigger everything right however since then every run of my app crashes with this exception. Try/Catch is not solution as it crashes every single time.

Did you experienced the same issue? Thanks a lot!

KRtekTM commented 1 year ago

Restart of Windows helped. Probably I reached the limit of RPC calls to the system.

DubyaDude commented 1 year ago

Yep, most likely just a Windows moment. Constant runs of the app might cause it, though information on that error is relatively sparse. Calling MediaManager.Dispose on the application exit (EX: AppDomain.CurrentDomain.ProcessExit) could help reduce the chances of running into this.

Edit: Seems like it could be related to the device's WMI process having issues, may just need to restart that service if you run across it again Source: https://stackoverflow.com/questions/22273809/managementclass-getting-hresult-0x80010002-error