Skip to content

Why set default reus to singleton when using WithMefAttributedModel rule? #553

Answered by dadhi
zplan asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @zplan.

It set so because [PartCreationPolicy(CreationPolicy.Shared)] is the default in MEF.

Regarding non-MEF registrations - there is no distinction for them when they are already in the container registry.

There was an alternative to set Reuse.Singleton for the specific MEF registration,
but then you lose the ability to override the registration with the container rules. So there are pros and cons.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zplan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants