Change this to:

```C#
var ex = new InvalidOperationException(Resources.Error_DataCannotBeSentDuringWebSocketReconnect);
connection.OnError(ex);
return TaskAsyncHelper.FromError(ex);
```