This project has moved. For the latest updates, please go here.

ImportingConstructor - Multiparameters

Aug 16, 2011 at 12:01 PM

I am getting error in "Container.GetExportedValue"

while am using multi parameterised constructor with "ImportingConstuctor" attribute.


I have a viewmodel which has multiparameterised constructor

Public StudentViewModel(IStudentView view, IEnumerable<StudentType> StudentTypes):base(view)

I am getting error when executing below code.

"No valid exports were found that match the constraint"

StudentViewModel studentViewModel = Container.GetExportedValue<StudentViewModel>();

any help ??? 

Sep 6, 2011 at 11:15 PM

It sounds like some of the constructor arguments (i.e. IStudentView  and StudentType) cannot be satisfied; which is typically due to the fact that there are no implementations of those contracts (or their dependencies). What does your catalog contain?