You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I test my code on a Console App before putting code in my MAUI application, and the code works perfectly there.
Instead of that, what actually happened?
However, when I put the nearly exact same code in my MAUI application found here, the application becomes indefinitely frozen. I traced this back to the GetAsync method in the WebAPI.cs file. The method calls GetAsyncInternal, which returns a response object. The return statement gets called, but for some reason, in the MAUI application, after the return statement runs, this is where the application starts hanging.
Please see additional information
Which operating system are you running on?
Windows
Which .NET Runtime are you running on?
.NET Framework
Version
6
Relevant log output
No response
Example Code
try{KeyValueownedGames;if(user1a.Length ==17&& user1a.All(char.IsDigit)){using(dynamicplayerService= WebAPI.GetInterface("IPlayerService", apikeya)){ownedGames= playerService.GetOwnedGames(steamid: Convert.ToUInt64(user1a),
include_appinfo:true, include_played_free_games:true);}vargameCount= ownedGames["game_count"].AsString();if(string.IsNullOrWhiteSpace(gameCount)){StatusText="";InvalidText="User 1 is not valid or has no games, ensure User 1 is correct and try again";ButtonEnabled=true;return;}}else{stringuser1AsString;using(dynamicsteamUser= WebAPI.GetInterface("ISteamUser", apikeya)){KeyValuesteamId=await steamUser.ResolveVanityURL(vanityurl: user1a);user1AsString=(steamId["steamid"].AsString());if(string.IsNullOrWhiteSpace(user1AsString)){StatusText="";InvalidText="User 1 is not valid, ensure User 1 is correct and try again";ButtonEnabled=true;return;}}using(dynamicplayerService= WebAPI.GetInterface("IPlayerService", apikeya)){ownedGames= playerService.GetOwnedGames(steamid: Convert.ToUInt64(user1AsString),
include_appinfo:true, include_played_free_games:true);}vargameCount= ownedGames["game_count"].AsString();if(string.IsNullOrWhiteSpace(gameCount)){StatusText="";InvalidText="User 1 has no games, ensure User 1 is correct and try again";ButtonEnabled=true;return;}}foreach(var userGames in ownedGames[" games "].Children){
user1Games.Add(userGames[" name "].AsString());}}catch(Exceptione){
Debug.WriteLine(e);StatusText="";InvalidText="Your API key is not valid. Ensure you followed the instructions correctly and try again";ButtonEnabled=true;return;}
Additional Information
The entire project is open source, and the example code above is available in this file.
Currently in the process of seeing if this API can replace the old API I'm using, which is why the link above uses the new-api-testing branch. It's possible that I'm doing something wrong, but considering the code works in a console app, I'm very confused if I am doing something wrong. Thank you for looking at this problem. I am willing to provide as much information as possible, including debugging steps.
The text was updated successfully, but these errors were encountered:
If I'm interpreting the bug description correctly, you're hanging on await CallAsyncInternal, which suggests a threading problem, potentially a deadlock.
If I'm interpreting the bug description correctly, you're hanging on await CallAsyncInternal, which suggests a threading problem, potentially a deadlock.
Yes, sounds about right. Would you like me to record a video of what happens?
Edit: Also to clarify, I don't know of it's the CallAsyncInternal, or CallAsync that is causing the problem, since the hanging begins at the return line of the CallAsyncInternal. Thought I'd clarify that since I read the bug report again and realized I never mentioned which method's return statement it got stuck on.
What did you expect to happen?
I test my code on a Console App before putting code in my MAUI application, and the code works perfectly there.
Instead of that, what actually happened?
However, when I put the nearly exact same code in my MAUI application found here, the application becomes indefinitely frozen. I traced this back to the GetAsync method in the WebAPI.cs file. The method calls GetAsyncInternal, which returns a response object. The return statement gets called, but for some reason, in the MAUI application, after the return statement runs, this is where the application starts hanging.
Please see additional information
Which operating system are you running on?
Windows
Which .NET Runtime are you running on?
.NET Framework
Version
6
Relevant log output
No response
Example Code
Additional Information
The entire project is open source, and the example code above is available in this file.
Currently in the process of seeing if this API can replace the old API I'm using, which is why the link above uses the new-api-testing branch. It's possible that I'm doing something wrong, but considering the code works in a console app, I'm very confused if I am doing something wrong. Thank you for looking at this problem. I am willing to provide as much information as possible, including debugging steps.
The text was updated successfully, but these errors were encountered: