例外が発生します:1)制約に一致する複数のエクスポートが見つかりました:ContractName CompositionTest.C RequiredTypeIdentity CompositionTest.C
プログラム実行時
名前空間CompositionTest{
// [Export] // Also doesn't work
[Export(typeof(C))]
public class C
{
//[ImportAttribute(AllowRecomposition = true)] // also doesn't work
[Import(AllowRecomposition = true)]
public C PropertyC { get; set; }
}
class Program
{
static void Main(string[] args)
{
// Declare a composition container.
CompositionContainer compositionContainer = new CompositionContainer();
compositionContainer.ComposeParts( new C() );
compositionContainer.ComposeParts( new C() ); // exception here!
}
}
}
私は何が間違っているのですか?