Why are you trying to use the InjectionConstructor in the first place? Unity knows how to handle arrays out of the box.
The params is just syntactic sugar for the compiler. Under the cover of args2 is just a simple array.
[TestMethod] public void TestMethod1() { var container = new UnityContainer();
Update
If you use only some of these registrations, you will have to use ResolvedArrayParameter .
container.RegisterType<IMyClass, MyClass>( new InjectionConstructor( typeof(Class1), new ResolvedArrayParameter<Class2>( new ResolvedParameter<Class2>("1"), new ResolvedParameter<Class2>("2"))));
Brrr! This is super ugly, but it should solve your problem.
source share