I have some C# code that Im actually porting to VB.Net. Now I noticed ConfigureAwait(false) is used everywhere. A requirement is that the code be dependant on .Net 4.0
As you might know... ConfigureAwait(false) appears in .Net 4.5. How would I convert the following code to be compliant with .Net 4.0?
Is there a generic solution as ConfigureAwait occurs everywhere in the code
public async Task<ListResponse> GetResponseAsync(ListRequest request = null)
{
request = request ?? new ListRequest
{
Limit = _limit
};
using (var client = CreateMailClient("lists"))
{
var response = await client.GetAsync(request.ToQueryString()).ConfigureAwait(false);
await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false);
var listResponse = await response.Content.ReadAsAsync<ListResponse>().ConfigureAwait(false);
return listResponse;
}
}
ANSWER: Reference Microsoft.BCL.Async