// The Structure of the Container and the items public interface IContainer where TItem : IItem { } public class AContainer : IContainer
Another generics covariant problem...
Generic types in .NET are not covariant or contravariant - IContainer (which is what AContainer is) is not a subclass of IContainer - there is no valid cast between the two. This will be fixed in C# 4.