Trying to do a simple ConnectAsync in a BackgroundTask. It throws a Catastrophic Exception (0x8000FFFF) which can be seen when "Break on all Exceptions" is turned on. I have even rolled by my source to known good branches and it still does this.
my code:
IBandClient client = null;
try
{
client = await BandClientManager.Instance.ConnectAsync(band);
}
catch { }
Exception:
System.Exception occurred Message: Exception thrown: 'System.Exception' in Microsoft.Band.Store.dll Additional information: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
In v20217 the DLL name is Microsoft.Band.Store_UAP.dll
The curious thing is even after throwing this exception, client
still gets populated with an IBandClient
object.
Seems like we could do better in terms of the exception being thrown (or better yet not throw one).
The Band SDK documentation (section 9.3.2) indicates that one might notice an (expected but not blocking) exception when using the SDK within a background task of a Universal application, related to retrieval of the application ID.
Obviously "expected exceptions" are not ideal, but sometimes the design of the underlying platform APIs leave little choice.