Visual Studio中抱怨以下幾點:我無法等待等待?
public RelayCommand SendRegistrationCommand { get; private set; }
public async void SendRegistration()
{
HttpClient client = new HttpClient();
var response = await client.GetStringAsync("url");
// ... todo
}
Cannot await 'System.Threading.Tasks.Task<string>'
我想我這樣做過,GetStringAsync不是awaitable?
你能告訴我們完整的方法?也許它沒有用'async'修飾符標記? – tpeczek
@tpeczek ive發佈了函數 – Jason94
您可能將目標鎖定爲.NET 4.0。你能切換到4.5嗎? – dcastro