我的代码中的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;
}
答案 0 :(得分:3)
将resharper更新为最新版本,解决了问题