how can I add all referenced assemblies to the CompilerParams?

F

Freddy Willockx

I would like to add all referenced assemblies to my new assembly wich I'm
about to "compile".

I can't get it working.

I would like to compile a new assembly that uses the original assembly + all
it's references.

Am I making any sense here? Maybe look at the code below.

Thanks

Assembly a = aClass.ClassType.Assembly;
params.ReferencedAssemblies.Clear();
AssemblyName[] names = a.GetReferencedAssemblies();
foreach (AssemblyName name in names) {
params.ReferencedAssemblies.Add(name.Name);
}
params.ReferencedAssemblies.Add(a.FullName);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top