.NET Framework Bookmark and Share   
 index > Managed Extensibility Framework > Why multi ExportAttribute is not supportted by property?
 

Why multi ExportAttribute is not supportted by property?

When I add multi ExprotAttribute on a Type, it is working natural. But if I add multi ExprotAttribute to one Property. The MEF just found first ExportAttribute.

I found some code in AttributedComposablePartDefinition.GetExports method as follow, so I think it is by design. But why?
foreach(MemberInfomemberinmembers)
{
stringcontractName=member.GetContractNameFromExport(member.GetFirstAttribute<ExportAttribute>());
yieldreturnnewMemberInfoComposableItem(contractName,member);
}
boolinheritAttributes=(flags&BindingFlags.DeclaredOnly)==0;
foreach(TypetypeWithExportinCompositionServices.GetTypesWithExportAttributes(this._partType,inheritAttributes))
{
foreach(ExportAttributeexportAttributeintypeWithExport.GetAttributes<ExportAttribute>(false))
{
stringcontractName=typeWithExport.GetContractNameFromExport(exportAttribute);
yieldreturnnewMemberInfoComposableItem(contractName,typeWithExport);
}
}

  • Edited byColinHan Wednesday, October 22, 2008 10:06 AM
  •  
ColinHan
Thanks for the report. This is a known bug, and something hopefully we'll have fixed for the next drop.
Managed Extensibility Framework Team | My Blog: http://davesbox.com
David M. Kean
Thanks for the report. This is a known bug, and something hopefully we'll have fixed for the next drop.
Managed Extensibility Framework Team | My Blog: http://davesbox.com
David M. Kean

You can use google to search for other answers

Custom Search

More Threads

• MEF for Silverlight?
• Create a Ribbon Control for MS Project
• not able to call a vs 2005 c++ clr jni dll in java in machines without vs 2005?????
• MEF and Ninject, which are the differences between them and what does it imply?
• Is there any api to get start time of IIS webserver.
• pinvoke query
• MEF for server side applications
• Advice on Using .Net frame work with Open Xml for excel automation
• No "hard dependancy" but a new dependancy is introduced.
• bxsbankas