I am moving my class library helper for HttpWebRequest
(standard .net class) from .NET 4.6.2 to .NET core 3.1.
And I discovered the following issue with .NET core 3.1:
When I call responseStream.BeginRead
it calls via the Stack!
So it is the reason of issue: when stack ends application fails due to stack overflow error.
.NET 4.6.2 behavior is different - it calls BeginRead
on Thread Pool.
And it works right for years without any issue.
I cannot find the reason why .NET core 3.1
has different behavior for BeginRead
.
If you know how to fix HttpWebRequest
BeginRead
or any ideas share with me, please.