无法从使用中推断出TaskAwaiter

时间:2015-06-25 20:42:08

标签: c# async-await

我的代码中的await下面有一条红线说: The type arguments for method 'TaskAwaiter<TResult> System.WindowsRuntimeSystemExtensions.GetAwaiter<TResult>(this Windows.Foundation.IAsyncOperation 1)' cannot be inferred from the usage. Try specifying the type arguments explicitly

虽然代码编译并且似乎工作正常但我只是想知道这意味着什么? (英语不是我的第一语言,所以我可能只是不理解这个消息)

private async void Init()
{
    var settings = new I2cConnectionSettings(I2CAddress);
    settings.BusSpeed = I2cBusSpeed.StandardMode;

    var aqs = I2cDevice.GetDeviceSelector(I2CControllerName);
    var dis = await DeviceInformation.FindAllAsync(aqs);
    _device = await I2cDevice.FromIdAsync(dis[0].Id, settings);
    _isInited = true;
}

1 个答案:

答案 0 :(得分:3)

将resharper更新为最新版本,解决了问题