Why am I getting “The type parameter must be invariantly valid…” error?
I'll attempt to shorten this code example: public interface IThing { //... Stuff } public class Thing1 : IThing { } public class Thing2 : IThing { } public interface IThingView<out T> { ICollection<T> ViewAll(); } public class ThingView<T> : IThingView<T> { ICollection<T> ViewAll() { return new List<T>(); } // There's a big operation here } public interface IThingViewerFactory { public IThingView<IThing> Build(string Which); } public class ThingViewerFactory { public IThingView<IThing> Build(string Which) { if(Which.Equals("Thing1") { return new (IThingView<IThing>)new ThingViewer<Thing1>();}