Closed sgf closed 2 years ago
@sgf
The exception is saying it all. In the provided asms
there are no legit service types.
It may mean that you don't have the types at all or no public
types. In the later case, if you want to register non-public types, then you need to pass nonPublicServiceTypes: true
to RegisterMany
(btw, the exception message has this information as well).
Regarding complexity, if you are manipulating assemblies, you are already on the complex ground...
I don't see how container.RegisterMany(new[] { typeof(A).Assembly }, serviceTypeCondition: type => type == typeof(X));
makes it harder, but I am open for suggestions.
i think,maybe the reason is what types i want to register is winform UseControl. maybe because it's Implementation of IDisposable.
@sgf The exception is saying it all. In the provided
asms
there are no legit service types. It may mean that you don't have the types at all or nopublic
types. In the later case, if you want to register non-public types, then you need to passnonPublicServiceTypes: true
toRegisterMany
(btw, the exception message has this information as well).Regarding complexity, if you are manipulating assemblies, you are already on the complex ground... I don't see how
container.RegisterMany(new[] { typeof(A).Assembly }, serviceTypeCondition: type => type == typeof(X));
makes it harder, but I am open for suggestions.
thank,you
I refer to this example: https://stackoverflow.com/questions/42368192/dryioc-registermany-implementations-of-interface by the way.DryIoc's API design looks little complex,not easy to use.