I think I found the solution for the user creation crash:
follow step 4 :
I think I found the solution for the user creation crash:
follow step 4 :
Hi Adman1974. Congratulations on your accomplishment
I have added a config file to my game and it no longer crashes. Thank you both
Can you please provide a sample of code that you used to see if the user is signed in, and if not, display the panel so they can choose a user to sign in with
Thanks Adman1974
The status I am getting is UserInteractionRequired
I have noticed I cannot sign into my xboxone sandbox despite adding it as a test account and updating the settings by clicking the Test button
I have emailed Microsoft for ideas, then I will try again
I will keep you posted
Thanks again
Why is Adman1974ās post flagged?
OK so I have tried a few different bits of code based on what has been kindly provided on this forum but I still cannot get the sign in to work. I have kept the following code very very simple to demonstrate the point it is breaking down
private async void GetUser()
{
SignInResult signInSilentlyTask;
SignInResult signInLoudlyTask;
user = new XboxLiveUser();
debug = āā;
var dispatcher = Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher; signInSilentlyTask = await user.SignInSilentlyAsync(null);
if (signInSilentlyTask.Status == SignInStatus.Success) { debug += "Worked "; } else { debug += signInSilentlyTask.Status.ToString(); }
if (signInSilentlyTask.Status == SignInStatus.UserInteractionRequired) { signInLoudlyTask = await user.SignInAsync(null); // **Error here** debug += signInLoudlyTask.Status.ToString(); }
debug += " exit";}
When I try user.SignInAsync(null); or user.SignInAsync(dispatcher); I get an error
System.InvalidOperationException āOperation is not valid due to the current state of the objectā
System.InvalidOperationException occurred
HResult=0x80131509
Message=Operation is not valid due to the current state of the object.
Source=
StackTrace:
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at CatStack.Game1.d__163.MoveNext() in C:\Users\xx\source\repos\CatStack\CatStack\Game1.cs:line 561
I have tried different combinations, null, dispatcher, two dispatcher objects, .CoreApplication.GetCurrentView() instead of .CoreApplication.MainView, try / catch statements. Nothing seems to work. I get the same error message
I am signed into my sandbox with a valid user. I can see my profile when I launch the game and press the XBox home button
But I cannot seem to be able to get the signed in user or force a sign in
Your help will be much appreciated
I think it could be a problem with the code running in a non-UI thread. Could you try this?
signInLoudlyTask = await user.SignInAsync(dispatcher);
Hi KakCAT. Thanks for your reply
I had initially tried what you had posted before with no luck but I thought I would try again just to make sure
I discovered there was a subtle difference in the error message I was getting (Iām not sure why it didnāt appear yesterday):
The application requesting authentication tokens is either disabled or incorrectly configured
The solution was to right click the game --> Store --> Associate App with Store
I think the reason why I got this error is because I generated my config file from Unity so it has about 8 lines in it (instead of the 3 you sent to me) - including links to the ids I created. The reason I generated it from unity is because I wanted to look at the backend files while trying to work out how to get the sign in working
I am going to try working with a leaderboard now and then trying to get a game published (it is a simple game). If successful I will document a start to end process (along with mistakes I made along the way) and post it in a blog for use with this forum
Thanks to everyone for your help
Thanks for the followup! This is super confusing stuff, and the Internet Gods smile on those who fix their own problems and post their solutions for others to see!
I donāt want to be all āI told you so!ā, but just for future coders⦠there are some hoops you need to jump through before your stuff starts working. And youāll get weird esoteric errors if your app is not recognized by Microsoft.
Good luck with leaderboards! Please do document and share your problems and solutions!
1 year later Iāve found a proper way to discover the reasons why Xbox live DLL hard crashes without apparent reason.
If you set up your project properties -> Debug to debugger type Mixed (Managed and Native) you get a very descriptive error in the Debug Output when the crash happens. For some reason that message does not appear without native debugging.
So finally I found a bug (only happenning when debugging) of my game randomly crashing: It was a Xbox Live throttling message.
I know itās an old thread, but it will surely help somebody if heās running into the hard crashes ( C# coders sure are not used to get those
)
Reviving a VERY old thread⦠My game (Hidden in Plain Sight) was published to the Xbox marketplace about 8 years ago.
Just recently, it stopped working. Which is to say, users are now reporting an error when starting the game āError signing in to Xbox Liveā¦ā
I havenāt changed anything. I sold my Xbox One years ago. Did something change on the back end? Are Xbox Live services no longer available or have they been deprecated or something?
This is the code that is being a called and showing the āError signing in to Xbox Liveā¦ā message box
private async void GetUser(int index) { try { if (Globals.Xboxusers[index] == null) { Windows.System.UserPicker p = new Windows.System.UserPicker(); var pickedUser = await p.PickSingleUserAsync(); XboxLiveUser user = new XboxLiveUser(pickedUser); SignInStatus signInStatus; SignInResult signInSilentlyTask = await user.SignInSilentlyAsync(null); signInStatus = signInSilentlyTask.Status; if (signInSilentlyTask.Status == SignInStatus.Success) { Globals.Xboxusers[index] = user; Globals.GamerTags[index] = user.Gamertag; UserSignedIn = true; UserSigningIn = false; } else if (signInSilentlyTask.Status == SignInStatus.UserCancel) { Globals.GamerTags[index] = "Player " + index.ToString(); UserSignedIn = false; UserSigningIn = false; MessageBoxScreen m = new MessageBoxScreen("Cancelled signing in to Xbox Live..."); ScreenManager.AddScreen(m, ControllingPlayer); } else if (signInSilentlyTask.Status == SignInStatus.UserInteractionRequired) { SignInResult signInNotSilentlyTask = await user.SignInAsync(null); if(signInNotSilentlyTask.Status == SignInStatus.Success) { Globals.Xboxusers[index] = user; Globals.GamerTags[index] = user.Gamertag; UserSignedIn = true; UserSigningIn = false; } else { Globals.GamerTags[index] = "Player " + index.ToString(); UserSignedIn = false; UserSigningIn = false; MessageBoxScreen m = new MessageBoxScreen("Error signing in to Xbox Live..."); ScreenManager.AddScreen(m, ControllingPlayer); } } } } catch (System.Exception ex) { Globals.GamerTags[index] = "Player " + index.ToString(); UserSignedIn = false; UserSigningIn = false; MessageBoxScreen m = new MessageBoxScreen("Error signing in to Xbox Live..."); ScreenManager.AddScreen(m, ControllingPlayer); } }
Well, it isnāt broken at the very least, but certainly is deprecated since UWP-based builds altogether are deprecated. That said, we had a UWP build on Xbox One until yesterday (actually, still do, because we just submitted the updated GDKX build and itās still in cert), and ours is still able to sign-in. Tough to say exactly what problem youāre having, or if youād be able to submit an updated UWP build even if you tried to fix it. The only significant difference I see between your XSAPI use and ours is that we donāt attempt to use the Windows UserPicker first.
There has been some discussion about this on a Microsoft Game Development discord ā apparently something recently broke between UWP applications and Xbox Live services. Itās unclear if/when it will get fixed, and it doesnāt sound like itās very high priority.
Iām happy (and sad) to hear that itās not only my game, but a whole class of games made for the Creators Program.
But suffice to say, this isnāt a Monogame issue.