cel Posted December 5, 2003 Posted December 5, 2003 Here's what I want to do, I have a compiled assembly of code, which I've used: myCodeCompiler = dynCompiler.CreateCompiler() myCompilerResults = myCodeCompiler.CompileAssemblyFromFileBatch(myCompilerParameters, files) Now that I have all of my various files compiled at runtime, I want to throw the code into a parent class. So I have the functionality of being able to write functions/procedures in my files and not have to create a class for them. Quote
cel Posted December 7, 2003 Author Posted December 7, 2003 I really doubt this is difficult for anyone familiar with reflection. I just want to force a class to be a subclass of a different class. Quote
*Gurus* divil Posted December 7, 2003 *Gurus* Posted December 7, 2003 It's not going to happen. Reflection doesn't work that way. Once you've compiled your assembly there is no longer any code to modify, and why would you want to make a class suddenly be a subclass of a different class? Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
cel Posted December 7, 2003 Author Posted December 7, 2003 I know it can work, I've seen it done, although I'm not sure how "functionality of being able to write functions/procedures in my files and not have to create a class for them." Quote
*Experts* Volte Posted December 7, 2003 *Experts* Posted December 7, 2003 You need to create the class programmatically and insert your functionality into the class, and compile the whole thing at once. You can't just inject your code into the compiled DLL. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.