Experiencing Http timeouts when Http calls are made from two .Net frameworks together (.Net Framework 4.8 and .Net Standerd 2.0)

Gaurav Awasthi 0 Reputation points
2025-05-21T11:13:34.7433333+00:00

I have an ASP.Net Web API built on .Net Framework 4.8 and we are using a self created nuget library which is built on .Net Standerd 2.0.

this nuget library makes Http calls to 3rd party service.

To make Http calls we are using single HttpClient object for all the calls happening to this 3rd party service.

On a certain load we are seeing Http calls are timing out.

Here We make Http calls from ASP.Net Web API (.Net Framework 4.8) also so there is mix of Http calls going from HttpClient from .Net Framework 4.8 and .Net Standerd 2.0.

With mix of HttpClient We see around 10% of Http calls are timing out.

NOTE 1: I also tried creating this nuget library on .Net 4.8 and with same HttpClient pattern and same load it works well i.e. No Http timeouts when .Net platforms are same.

NOTE 2: When I make calls only to third party service then also it works when. i.e. only http calls made from .Net Standerd 2.0.

NOTE 3: I have timeout problem only when Http calls are made from both .Net platforms (.Net Framework 4.8 and .Net Standerd 2.0. )

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,264 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,476 Reputation points Volunteer Moderator
    2025-05-22T16:05:37.1533333+00:00

    .net standard 2.0 is just a defined api. when you use a .netstandard 2.0 library with net48, its using the the net48 runtime and libraries. so its the same HttpClient library code in both. you must have some code interaction that causes your issue.

    note: when you build a .netstandard 2.0 library, it uses an abstract definition of a subset of the .net runtime to build. at runtime it uses the hosting apps real runtime. so in practice a .netstandard 2.0 library when linked to 4.8 app is the same as any 4.* library.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.