Right now, when a ServiceDescriptor is not keyed, accessing all the keyed properties (KeyedImplementationInstance, KeyedImplementationType, KeyedImplementationFactory) will throw an InvalidOperationException.
Similary, when the ServiceDescriptor is not keyed, accessing all the non-keyed properties(ImplementationInstance, ImplementationType, ImplementationFactory) will also throw an InvalidOperationException`.
Ideally the application should check the value of IsKeyedService before accessing these properties, but applications that are not yet aware of keyed services break because of these exceptions.
We should remove this behavior. Note that applications that do not "keyed services aware" can still break because all the expected properties will be null, but it should cause less issues.
@halter73 @steveharter @davidfowl
Right now, when a
ServiceDescriptoris not keyed, accessing all the keyed properties (KeyedImplementationInstance,KeyedImplementationType,KeyedImplementationFactory) will throw anInvalidOperationException.Similary, when the
ServiceDescriptor is not keyed, accessing all the non-keyed properties(ImplementationInstance,ImplementationType,ImplementationFactory) will also throw anInvalidOperationException`.Ideally the application should check the value of
IsKeyedServicebefore accessing these properties, but applications that are not yet aware of keyed services break because of these exceptions.We should remove this behavior. Note that applications that do not "keyed services aware" can still break because all the expected properties will be
null, but it should cause less issues.@halter73 @steveharter @davidfowl