ApplicationView.GetForCurrentView() occasionally throws "The service is already registered"
Hong
1,211
Reputation points
ApplicationView avCurrent = ApplicationView.GetForCurrentView();
The above code occasionally throws the following exception:
System.Exception: The service is already registered.
The service is already registered.
Stack Trace:
at System.Runtime.InteropServices.McgMarshal.ThrowOnExternalCallFailed(Int32, RuntimeTypeHandle) + 0x21
at __Interop.ComCallHelpers.Call(__ComObject, RuntimeTypeHandle, Int32, Void*) + 0xbe
at __Interop.ForwardComStubs.Stub_3TThis, TResult + 0x37
at Windows.UI.ViewManagement.ApplicationView.GetForCurrentView() + 0x2c
It is rare. I am curious about the possible cause.
Sign in to answer