Search Unity

Exception whilst trying to open the User picker on Xbox One

Discussion in 'Windows' started by BeehiveGames-Coxlin, Sep 2, 2017.

  1. BeehiveGames-Coxlin

    BeehiveGames-Coxlin

    Joined:
    Aug 6, 2012
    Posts:
    2
    Hi there.

    I am getting an exception:

    Faulted

    -2146233088

    AggregateException_ctor_DefaultMessage

    Access is denied. (Excep_FromHResult 0x80070005)

    When trying to open the user picker with the following code

    private void DoSignIn()
    {
    #if ENABLE_WINMD_SUPPORT
    var autoPicker = new Windows.System.UserPicker { AllowGuestAccounts = true };
    autoPicker.PickSingleUserAsync().AsTask().ContinueWith(
    task =>
    {
    if (task.Status == TaskStatus.RanToCompletion)
    {
    this.XboxLiveUser.WindowsSystemUser = task.Result;
    this.XboxLiveUser.Initialize();
    StartCoroutine(SignInCoroutine());
    }
    else
    {
    var sb = new System.Text.StringBuilder();
    sb.AppendLine(task.Status.ToString());
    sb.AppendLine(task.Exception.HResult.ToString());
    sb.AppendLine(task.Exception.Message);
    sb.AppendLine(task.Exception.InnerException.Message);
    throw new Exception(sb.ToString());
    }
    });
    #endif
    }

    Can anyone shed some light on why this would be?

    Cheers
    Lindsay
     
  2. Ayrik

    Ayrik

    Joined:
    Aug 31, 2008
    Posts:
    430
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    I recommend you edit your post to add code-tags, which makes it easier for people to read then.