I have a type that accepts these parameters:
public SmaSeries(ISeries<decimal> parent, int periods, TierKind? runOnTier = null)
I am trying to create an instance of this type using Activator.CreateInstance (the overload that accepts type and args) by passing object[] in the args parameter:
new object[]
{
new DecimalSeries(),
20,
new Nullable<TierKind>(TierKind.Client)
}
//DecimalSeries implements ISeries<decimal>
Getting back Constructor on type ‘SmaSeries’ not found.
Is there a way to fix the args so the activator finds the constructor?
Thanks.
Works fine in .NET 4.5, and even 2.0
I think perhaps: is your constructor or one of the types maybe not public?