Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8590875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:23:44+00:00 2026-06-11T23:23:44+00:00

I have a type that accepts these parameters: public SmaSeries(ISeries<decimal> parent, int periods, TierKind?

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:23:45+00:00Added an answer on June 11, 2026 at 11:23 pm

    Works fine in .NET 4.5, and even 2.0

    using System;
    
    class SmaSeries
    {
        public SmaSeries(ISeries<decimal> parent, int periods,
             TierKind? runOnTier = null) { }
        static void Main()
        {
            object[] args = new object[] 
             {
                new DecimalSeries(),
                20,
                new Nullable<TierKind>(TierKind.Client)
             };
    
            object obj = Activator.CreateInstance(typeof(SmaSeries), args);
        }
    }
    enum TierKind { Client }
    interface ISeries<T> { }
    class DecimalSeries : ISeries<decimal> { }
    

    I think perhaps: is your constructor or one of the types maybe not public?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method Foo4 that accepts a parameter of the type Func<>. If
I have a function that accepts a generic parameter T that is of type
I have generic type that looks like: public class GenericClass<T, U> where T :
Lets say I have WSDL that defines an operation that accepts a complex type,
We have some code that looks like this: class Serializer { public: template<class Type>
I currently have a type that I inject into my controllers that's used for
I have a data type that contains a set and a method that expects
I have a Type MenuItem that has one-to-many relationship with itself through Children property.
Is it possible to have a type constraint that is an or of two
I have an archetype content type that previously was not folderish. Now I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.