ImportingConstructor vs Import

Oct 25, 2010 at 2:42 PM
Edited Oct 25, 2010 at 3:10 PM


During a development, I noticed that in some situation using ImportingConstructor works and Import not.

If I use ImportingConstructor, I got the same instance of the class. When I use Import, I got a different instance.


What are the difference between ImportingConstructor and Import?





Oct 27, 2010 at 2:48 PM

For your imports do you notice this when you have to call CompositionInitializer.SatisfyImports(this); ?  If so the container it uses could be different that what ImportConstructor is using.

Past that I'm dealing with the same issue myself.


Oct 28, 2010 at 12:28 PM

In both cases, I don't call the SatisfyImports.

Oct 28, 2010 at 6:27 PM

Could you provide us a sample code that reproduces the problem?