Is there a possibility that I can put some of my code in non-compiled form with my application and then make changes to it on the fly and the application can then just use the new version onwards?
If it is possible (which i secretly know it is using CodeDOM), are there any issue to watch out for using this approach for pluggability (aside from the code protection issue)?
Is there a example available which i can re-use?
You’ve already said you know how to do with with CodeDOM – why not just use that?
If you’re happy with it being C# code, then
CSharpCodeProviderdoes an admirable job. If you’re feeling more adventurous, you might want to consider Boo – read Ayende Rahien’s book on building DSLs in Boo for more information and advice.For an example of using
CSharpCodeProvider, you could download Snippy from my C# in Depth web site. Basically Snippy lets you type in a code snippet and run it, without bothering to declare a class etc. It doesn’t do much more than build and run code, so it’s a fairly handy example 🙂For plenty more examples, search for CSharpCodeProvider on Stack Overflow. Here’s a short but complete one – code for ‘hello world’ is compiled and then executed.