So we are upgrading SS from 5.5 to 5.6 in preparation for 5.7 (NetCore3.1). Something changed that broke our ability to put constraints on our app host.
public abstract class DefaultAppHost<TServiceInterfaceAssembly> : AppHostBase where TServiceInterfaceAssembly : IServiceInterfaceAssembly
This code worked in 5.5, but now in 5.6 we get the following error:
System.TypeLoadException: GenericArguments, 'System.Object', on 'IM.ServiceStack.Features.AwsLambdaServerFeature.DefaultAppHost`1[TServiceInterfaceAssembly]' violates the constraint of type parameter 'TServiceInterfaceAssembly'. at System.RuntimeTypeHandle.Instantiate(RuntimeTypeHandle handle, IntPtr* pInst, Int32 numGenericArgs, ObjectHandleOnStack type) at System.RuntimeTypeHandle.Instantiate(Type inst) at System.RuntimeType.MakeGenericType(Type instantiation)
Our workaround was to remove the constraint, but that feels a little dirty as logically we want that constraint on our DefaultAppHost.
What would be the proper workaround for this issue going forward?