Skip to content

17.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 16 Nov 00:41

Refit 17.0.0 separates reflection-based clients from the core package, makes JSON behavior explicit, and moves modern .NET support to .NET 10 and .NET 11. This is a major release with framework, package and API changes. Rebuild all projects containing generated Refit clients after upgrading.

.NET 8 and .NET 9 removal

.NET 8 and .NET 9 reached Microsoft's end of support on 10 November 2026. Refit removes these targets so maintenance and dependency updates focus on supported modern runtimes. Retarget applications to .NET 10 LTS or .NET 11 before upgrading. See the .NET support policy.

.NET Framework 4.6.2 (net462) removal

Refit removes net462 ahead of Microsoft's 12 January 2027 end-of-support date. Combining this transition with the other breaking changes reduces the legacy build and dependency combinations we maintain. Remaining .NET Framework assets cover 4.7, 4.7.1, 4.7.2, 4.8 and 4.8.1; targets vary by package. Prefer 4.8 or 4.8.1 where supported. See the .NET Framework support policy.

Reflection and generated clients

  • RestService.For, RequestBuilder.ForType and reflection method metadata move to Refit.Reflection. Add that package to retain those APIs, or use RestService.ForGenerated with a source-generated JSON context.
  • AddRefitClient and AddKeyedRefitClient move to Refit.HttpClientFactory.Reflection. Generated client registration remains in Refit.HttpClientFactory.
  • Reflection, Newtonsoft.Json and XML integrations do not promise trimming or Native AOT compatibility. Use generated clients with System.Text.Json metadata for trimmed or Native AOT applications.

JSON defaults and API migration

  • Default JSON uses numeric enums, rejects numbers encoded as strings, and reads object values as JsonElement. Configure converters, naming and number handling explicitly when an API requires another wire format.
  • JSON options require generated metadata or an explicitly registered reflection integration. Problem details use Refit's reader, including validation extensions.
  • Custom URL formatters use IParameterAttributeProvider. Custom content serializers must migrate from the removed GetFieldNameForProperty contract.
  • Review the full Refit 17 migration guide for form bodies, enum formatting, generated code and reflection registration requirements.

Dependencies and examples

Updated ReactiveUI.Primitives to 10.0.0 and TUnit to 1.85.0. Microsoft dependencies retain separate .NET 10 and .NET 11 version bands, and deliberately bounded Roslyn versions remain unchanged. Removed the unused regular-expression package pin while retaining the documented cryptography security override. Retry examples use Refit's own HTTP retry handler, including server retry timing hints, without Polly dependencies. Documentation examples build for both modern runtimes and use generated metadata where required for trimming.

Upgrading

Package version numbers do not express the support lifecycle of the underlying runtime. Dependency majors and platform requirements can change independently. Check each package's target frameworks and dependencies before upgrading. If retargeting must wait, use a compatible Refit 16 release while planning the migration. Staying on an older package does not extend Microsoft's runtime support.

🗞️ What's Changed

💥 Breaking Changes

🧹 General Changes

📝 Documentation

📦 Dependencies

  • baf69ae chore(deps): update actions/setup-dotnet digest to 0f4a354 (#2375) renovate[bot]

🔗 Full Changelog: v16.4.0...v17.0.0

🙌 Contributions

🌱 New contributors since the last release: @AtakanUk
💖 Thanks to all the contributors: @AtakanUk, @glennawatson

🤖 Automated services that contributed: renovate[bot]