Skip to content

"Microsoft.Extensions.Http.Resilience 8.0.1" adds 1.2 MBytes of packages #4944

Answered by martintmk
barruka asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @barruka, you are right that Microsoft.Extensions.Http.Resilience adds a bunch of dependencies. The good thing is that all these (up to the Polly itself) are trimming-friendly. So if you care about the publish size, I recommend to enable native AOT.

I did some tests just to see how some HTTP features affect the package size:

Hello World Console - 1.2MB

Console.WriteLine("Hello World");

HTTP Client - 5.1MB

var client = new HttpClient();
var result = await client.GetStringAsync("https://jsonplaceholder.typicode.com/todos");

HTTP Client with ResilienceHandler - 5.8MB

var resilienceHandler = new ResilienceHandler(
    new ResiliencePipelineBuilder<HttpResponseMessage>()
        .AddRetry(new

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RussKie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4937 on February 14, 2024 12:47.