You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected diamond-depndency conflict if multi-versions referenced and third-party component does not update - does not affect HttpClientFactory [ System.TypeLoadException when referencing both Polly 7 and transitive Polly 6 ] #615
Assuming a solution with the following project/code structure:
PollySeven.MyHttpClient depends on Microsoft.Extensions.Http.Polly (which depends on Polly v6). PollySeven.MyHttpClient uses RetryAsync() extension method to register MyService. PollySeven depends on PollySeven.MyHttpClient and Polly v7. PollySeven uses MyService.
PollySeven
publicstaticvoidMain(string[]args){varservices=newServiceCollection();services.AddMyServices();ServiceProviderprovider=services.BuildServiceProvider(true);varservice=provider.GetRequiredService<MyService>();// System.TypeLoadException:// 'Could not load type 'Polly.RetrySyntaxAsync' from assembly// 'Polly, Version=7.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc'.'}