A Microsoft platform for building and publishing apps for Windows devices.
ApplicationView.GetForCurrentView() occasionally throws "The service is already registered"
Hong
1,526
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.
Developer technologies | Universal Windows Platform (UWP)
Developer technologies | Universal Windows Platform (UWP)
Sign in to answer