Why does assigning a value to an unused variable make a difference in the functionality of this async code?
问题 I've got this code: private async Task SavePlatypusComplianceFileOnServer(string year, string month) { string monthAsMM = ReportRunnerConstsAndUtils.GetMonthAsMM(month); HttpClient client = new HttpClient(); client.BaseAddress = new Uri(ReportRunnerConstsAndUtils.SERVER_BASE_ADDRESS); String uriToCall = String.Format("/api/PlatypusCompliance/{0}/{1}{2}", _unit, year, monthAsMM); HttpResponseMessage response = await client.PostAsync(uriToCall, null); } ...that works fine. On looking at it,