Mac OS X の Mono (3.2.1) でこの単純な小さなテストを実行すると、コンソールに応答が出力されず、代わりにShutting down finalizer thread timed out.
Is there something wrong with this code or is my Mono misbehaving? と表示されます。
using System;
using System.Net.Http;
namespace VendTest
{
class MainClass
{
public static void Main(string[] args)
{
Client client = new Client();
client.HttpClientCall();
}
}
public class Client
{
HttpClient client;
public Client()
{
client = new HttpClient();
}
public async void HttpClientCall()
{
HttpClient httpClient = new HttpClient();
HttpResponseMessage response = await httpClient.GetAsync("http://vendhq.com");
string responseAsString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseAsString);
}
}
}