I have export attributes on my views. and each view imports a viewmodel(stocktrader design)
based on some requiremenet I had to do call satisfyimports. but when I call this, I get above error.(mentioned in subject line)
I went into the CompositionInitliaser class and commented below check and everything seems to work fine.
based on some requiremenet I had to do call satisfyimports. but when I call this, I get above error.(mentioned in subject line)
I went into the CompositionInitliaser class and commented below check and everything seems to work fine.
public static void SatisfyImports(ComposablePart part)
{
if (part == null)
{
throw new ArgumentNullException("part");
}
var batch = new CompositionBatch();
batch.AddPart(part);
//if (part.ExportDefinitions.Any())
//{
// throw new ArgumentException(string.Format(CultureInfo.CurrentCulture,
// @"Cannot call SatisfyImports on a object of type '{0}' because it is marked with one or more ExportAttributes.", part.ToString()), "part");
//}
i think i'm missng something. can anyone help me understand the consequences of commenting above check?