'stream.ReadTimeout' threw an exception of type 'System.InvalidOperationException' sending photo to telegram bot
I wrote below code for sending a photo to my bot, but in my stream, I have two exceptions for read and write and my photo was not send. I think maybe the reason was this error, but I couldn't fix it: stream.ReadTimeout threw an exception of type 'System.InvalidOperationException' using (var stream = System.IO.File.Open("a.jpg", FileMode.Open)) { var fileToSend = new FileToSend("a.jpg", stream); Task.Run(() => bot.SendPhotoAsync(u.Message.Chat.Id, fileToSend).ConfigureAwait(false)); } René Vogt The reason for this exception is probably that you Dispose the stream immediatly after starting the