我在 dll 中定义了一个方法,如下所示:
public async Task<bool> ConnectAsync(PtiType clientType, PtiType communicationType,string serverIp,int portNum= 3200)
在不同的项目中,我引用该 dll 并使用 'await' 关键字。我从 Intellisense 得到了这个错误。
看看那个参考的元数据,我看到了这个
[DebuggerStepThrough]
public Task<bool> ConnectAsync(PtiType clientType, PtiType communicationType, string serverIp, int portNum = 3200);
我的 async 关键字发生了什么?
更新:我在这两个项目中都使用 .NET 4.5。