更新时间:2021-11-30 21:13:59
***方法是使方法async
生效,因为编译器错误指示:
The best approach is to make the method async
, as the compiler error indicates:
public async Task<Stream> CreateSerialPortStreamAsync(string serialPortName)
这也需要更改界面:
Task<Stream> CreateSerialPortStreamAsync(string serialPortName);
是的,此方法的所有调用方都需要更新.
And yes, all callers of this method will need to be updated.