Quantcast
Channel: Managed Extensibility Framework
Viewing all articles
Browse latest Browse all 265

New Post: Cannot call SatisfyImports on a object of type 'xx' because it is marked with one or more ExportAttributes

$
0
0
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.
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?

Viewing all articles
Browse latest Browse all 265

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>