Export with custom metadata duplicated

Jan 13, 2010 at 11:59 AM

Hi there,

I'm currently investigating this issue but would be interested if anyone else has come accross it. I have a silverlight solution with multiple dlls built into the same xap, and am composing using PartInitializer.SatisfyImports().

The problem is, that when the export is attributed strongly typed custom metadata, it gets imported twice into the collection in the application attributed with ImportMany. Will follow up when I have an example solution that duplicates the issue.




Jan 13, 2010 at 3:50 PM

My guess is that you have a raw ExportAttribute and your custom metadata attribute attached to your type and your custom metadata attribute inherits from ExportAttribute, which causes the class to be exported twice. My suggestion would be to simply remove the raw ExportAttribute and only use your custom attribute.

Jan 15, 2010 at 3:11 AM

Many thanks, this was indeed the problem.

The application is here for those interested,