Skip to content

Conversation

@jayfunc
Copy link
Contributor

@jayfunc jayfunc commented Aug 6, 2025

Hi! Thanks for your work, but I came across the error when I used this package in my WinUI 3 project with .NET 8.

I tried to get the auth URL, and it gave me an error: "Root element is missing". After forking it and locating it, the error seems like something is wrong with the Stream.

I added a few lines based on the comment below:
https://stackoverflow.com/questions/10125810/root-element-is-missing

And the error no longer exists. I also tested some other functions like getting user info and posting scrobbling, and they worked well.

I just created this pull request to make this package more stable and with fewer bugs.

Hope this helped!

@wo80
Copy link
Collaborator

wo80 commented Aug 12, 2025

Hi @jayfunc ,

sorry for the late reply. I finally had some time to take a closer look. The cause of this problem is 7f89630.

var doc = GetXDocument(stream);
var responseContainsError = ResponseParser.Default.TryParseResponseError(doc, out string message, out int error);
if (!response.IsSuccessStatusCode || responseContainsError)
{
throw new ServiceException(method, error, response.StatusCode, message ?? response.ReasonPhrase);
}
return GetXDocument(stream);
}

In the Request.PostAsync(...) method, GetXDocument(...) is called twice, while the method should just return doc. Could you delete your latest commit, do the fix and then force push, so this pull request gets updated?

Thanks for bringing this to my attention!

@jayfunc
Copy link
Contributor Author

jayfunc commented Aug 12, 2025

Hi, I have done the modification. Thank you for your response!

@wo80
Copy link
Collaborator

wo80 commented Aug 12, 2025

Thank you! I will do a patch release in the next days.

@wo80 wo80 merged commit 429e14c into avatar29A:master Aug 12, 2025
1 check passed
@wo80
Copy link
Collaborator

wo80 commented Aug 17, 2025

@jayfunc I have updated the nuget package.

@jayfunc
Copy link
Contributor Author

jayfunc commented Aug 17, 2025

@wo80 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants