box-windows-sdk-v2: a deadlock occurs when obtaining an access token.

Description of the Issue

In my Windows Forms application, a deadlock occurs when obtaining an access token. I think that “ConfigureAwait (false)” is necessary for “await getResponse (request, isStream, httpRequest)” on line 40 of Box.V2/Request/HttpRequestHandler.cs

Versions Used

.NET SDK:4.7.1

Steps to Reproduce

        private void button1_Click(object sender, EventArgs e)
        {
            StreamReader reader = new StreamReader("./config.json");
            string json = reader.ReadToEnd();
            IBoxConfig config = BoxConfig.CreateFromJsonString(json);
            BoxJWTAuth boxJWT = new BoxJWTAuth(config);
            string token = boxJWT.AdminToken();  // <<== deadlock
        }

Error Message, Including Stack Trace

No message due to deadlock. The getResponse method of HttpRequestHandler class is trying to return “StatusCode: 200, ReasonPhrase: ‘OK’, Version: 1.1, Content: System.Net.Http.StreamContent, Headers:”.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 20 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Why is this labeled as a question? It’s quite obviously a bug.

once i hit the line of getting a token my app stops responding. has this been fixed on nuget yet?

@sin5, thank you for opening this issue. We will take a look ASAP and get back to you soon. Thanks!