Improve exception message when RegisterCollection is called twice #378

Open
dotnetjunkie opened this Issue Feb 14, 2017 · 0 comments

Projects

None yet

1 participant

@dotnetjunkie
Collaborator

When RegisterCollection is called twice for the same collection type, Simple Injector throws the following message:

Collection of items for type XXX has already been registered and the container is currently not configured to allow overriding registrations. To allow overriding the current registration, please create the container using the constructor overload that takes a ContainerOptions instance and set the AllowOverridingRegistrations property to true.

The exception message doesn't explain that in case the user wants to append items to the current registration, he should call AdvancedExtensions.AppendToCollection.

@dotnetjunkie dotnetjunkie added this to the v4 milestone Feb 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment