reactiveui / splat

Makes things cross-platform
MIT License
967 stars 142 forks source link

Change the DI Microsoft to use KeyedServiceProvider insted of ContractDictionary #1074

Closed OleksandrTsvirkun closed 3 months ago

OleksandrTsvirkun commented 6 months ago

Microsoft.Extensions.DependencyInjection 8.0 provides an implementation for keyed service type registrations. Now Splat.Microsoft.Extensions.DependencyInjection provides own ContractDictionary for service registrations with contract. It leads to issues when Splat's IDependencyResolver and Microsoft's IServiceProvider provide two different instances for singleton object. I want to be sure both of provide the same instance for singleton object.

As far as Microsoft.Extensions.DependencyInjection provides the similat interface for registering keyed (contracted) service I suggest just update the implementation of Splat.Microsoft.Extensions.DependencyInjection adapter.

I've already done it and my changes successfully passed all tests.

github-actions[bot] commented 3 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.