ImportingConstructor vs Import

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

Hello,

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?

 

 

Thanks,

Adrien.

Oct 27, 2010 at 3: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 1:28 PM

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

Oct 28, 2010 at 7:27 PM

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