Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: Request to update Microsoft.Extensions.Options version in Polly 8.4.1 #2382

Open
joyf15 opened this issue Nov 13, 2024 · 1 comment

Comments

@joyf15
Copy link

joyf15 commented Nov 13, 2024

Is your feature request related to a specific problem? Or an existing feature?

We’re experiencing a recurring issue where tests fail due to the exception:
System.InvalidCastException: Unable to cast object of type 'System.TimeSpan' to type 'System.String'.

This issue was previously identified and resolved in Microsoft.Extensions.Options version 8.0.2 (see dotnet/extensions#4917). However, Polly version 8.4.1 still references Microsoft.Extensions.Options version 8.0.0, as noted in its Directory.Packages.props file (link to Polly’s repo).

Would it be possible to bump the Microsoft.Extensions.Options package version in Polly to 8.0.2 to avoid these errors? This update would resolve the exception issue for many tests in our suite. Thanks for considering this request

Describe the solution you'd like

Bump the Microsoft.Extensions.Options package version in Polly to 8.0.2

Additional context

N/A

@martincostello
Copy link
Member

Raising this requirement may cause issues for others. We typically use the lowest possible version we can for API surface (rather than behaviour) to make Polly as widely compatible with its users as possible.

As such, I'm not inclined to not make this change on the basis that you can fix it yourself by adding an explicit package reference for [email protected] or later to your own test suite to pick up the bug fix. This is true of almost any dependency in any library - there is no need to ask the lowest building block of a dependency hierarchy to update a version in most cases to suit the needs of an arbitrary consumer at the top of the dependency hierarchy.

Polly 8.5.0 depends on newer versions if you target .NET 9, so another fix is to update Polly and .NET to the latest versions, which will also resolve your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants