splat icon indicating copy to clipboard operation
splat copied to clipboard

Change the DI Microsoft to use KeyedServiceProvider insted of ContractDictionary

Open OleksandrTsvirkun opened this issue 1 year ago • 0 comments

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.

OleksandrTsvirkun avatar Feb 16 '24 19:02 OleksandrTsvirkun