views:

10

answers:

0

I have merged 10 assemblies in to a single assembly using ILMerge. And tried to instantiate using below code:

//Assembly asm = Assembly.LoadFrom(@"D:\merg\Final\Merged\Actual.dll");
Assembly asm = Assembly.LoadFrom(@"D:\merg\Final\Merged\Final.dll");
            object[] param = new object[1] { null };

            Type t = asm.GetTypes().ToList<Type>().Find(delegate(Type type)
            {
                return 0 == string.CompareOrdinal(type.FullName, "Project.SdvGame");
            });
            object o = asm.CreateInstance(t.FullName, true, BindingFlags.Instance | BindingFlags.Public | BindingFlags.CreateInstance, null, param, CultureInfo.InvariantCulture, null);

And Getting Error - Constructor on type 'Project.SdvGame' not found. But for Actual.dll which not merged is working fine.

Please correct me where i m doing wrong.