0

I am creating a dll using codeProvider.CompileAssemblyFromSource, and passing in my code as a string.

I want the resultant dll to include another class that is already in my code and doesn't change.

ie, instead of this line:

compiledResults = codeProvider.CompileAssemblyFromSource(parameters,myCode);

I want something lie this:

compiledResults = codeProvider.CompileAssemblyFromSource(parameters,myCode, typeof(anotherClass));

Is that possible?

mcmillab
  • 2,752
  • 2
  • 23
  • 37
  • Why are you trying to add an already defined type? Maybe you can go with a different option. Like an IOC controller or maybe even load the assembly into the current AppDomain directly from what is using your compliedResults. – user959729 Jan 14 '13 at 19:51
  • I want to create a single dll rather than 2. Will try your other suggestions too, thanks – mcmillab Jan 14 '13 at 20:31

0 Answers0