Skip to content

Upgrade Autofac.Extensions.DependencyInjection to 11.0.0#25190

Merged
EngincanV merged 3 commits into
rel-10.3from
Autofac.Extensions.Dependency.11
Apr 1, 2026
Merged

Upgrade Autofac.Extensions.DependencyInjection to 11.0.0#25190
EngincanV merged 3 commits into
rel-10.3from
Autofac.Extensions.Dependency.11

Conversation

@maliming

@maliming maliming commented Apr 1, 2026

Copy link
Copy Markdown
Member

Description

https://github.com/autofac/Autofac.Extensions.DependencyInjection/releases/tag/v11.0.0

Upgrade Autofac packages and sync ABP's custom AutofacRegistration.cs with official v11.0.0:

  • Autofac 8.4.0 → 9.1.0, Autofac.Extensions.DependencyInjection 10.0.0 → 11.0.0, Microsoft.Bcl.AsyncInterfaces 10.0.2 → 10.0.4
  • Remove AnyKeyRegistrationSource registration (now native in Autofac 9.1.0)
  • Add MSDI KeyedService.AnyKey → Autofac KeyedService.AnyKey translation
  • Use Parameters.KeyedServiceKey<object>() for keyed factory key retrieval
  • Add .ExternallyOwned() to instance registrations
  • Remove unused keyedService variable left as dead code after refactoring
  • Add unit tests for keyed services and AnyKey support

Checklist

  • I fully tested it as developer / designer and created unit / integration tests
  • I documented it (or no need to document or I will create a separate documentation issue)

- Upgrade Autofac from 8.4.0 to 9.1.0
- Upgrade Autofac.Extensions.DependencyInjection from 10.0.0 to 11.0.0
- Upgrade Microsoft.Bcl.AsyncInterfaces from 10.0.2 to 10.0.4
- Remove AnyKeyRegistrationSource (now native in Autofac 9.1.0)
- Add MSDI KeyedService.AnyKey to Autofac KeyedService.AnyKey translation
- Use Parameters.KeyedServiceKey<object>() for keyed factory key retrieval
- Add ExternallyOwned() to instance registrations
- Add unit tests for keyed services and AnyKey support
@maliming maliming added the dependency-change Indicates a version change of a dependency (typically, upgrade) label Apr 1, 2026
@maliming

maliming commented Apr 1, 2026

Copy link
Copy Markdown
Member Author

@copilot Please review this PR.

Copilot AI commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

@copilot Please review this PR.

Reviewed the PR. The changes are well-aligned with the official Autofac 11.0.0 release. One cleanup made in commit 5ffc1b79: removed the unused keyedService variable that was left as dead code after the refactoring from keyedService.ServiceKey to requestContext.Parameters.KeyedServiceKey<object>().

Everything else looks correct:

  • AnyKeyRegistrationSource removal is appropriate (now native in Autofac 9.1.0)
  • MSDI KeyedService.AnyKey → Autofac KeyedService.AnyKey translation is correct
  • Parameters.KeyedServiceKey<object>() is the right approach for AnyKey scenarios
  • .ExternallyOwned() on instance registrations is necessary to prevent Autofac from disposing externally-owned objects
  • Tests cover all the new behaviors; all 33 tests pass

@maliming maliming requested a review from EngincanV April 1, 2026 02:04
@maliming maliming added this to the 10.3-preview milestone Apr 1, 2026
@EngincanV EngincanV merged commit e02423d into rel-10.3 Apr 1, 2026
4 checks passed
@EngincanV EngincanV deleted the Autofac.Extensions.Dependency.11 branch April 1, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency-change Indicates a version change of a dependency (typically, upgrade)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants