programatically insert code
I'm trying to make a form that allows users to register new tools with the database. I know how to update the sql server with that information, but there's quite a bit of code that accompanies specific tools (which alter labels on textboxes, etc.) Is it possible to programmatically update the software according to information put into a 'add new tool' form without touching the source code?
Re: programatically insert code
Do you play games? Have you ever played any that have mods built by the users? That would be one model for how to go about it. However, in cases like that, the mods are added the next time the program runs. You could kind of get around that by breaking the program up, perhaps, so long as the part that is being modified is not the part that is being run.
Does that sound like a viable option?
Re: programatically insert code
Hmm...I don't play games but I assume it similar to patches...I suppose I'd have to set up a system where the program checks for updates, and adding a new tool would insert the needed update in another batch of code to be run then. That may be more trouble than its worth in my application, since we have plenty of programmers on site, who could dive into the source code and make the alterations. Could you directly alter the code behind a .NET application without rebuilding? It doesn't seem likely...
Re: programatically insert code
Somewhere in recent history right here in this forum there was a description of how to compile code at runtime. You would need to do some text manipulation, and then feed the assembled text into whatever it was (There is a .NET library for CodeDom and Compiler objects . . .) which would compile at Runtime. I'll see if I can find the post I am referring to and if I do, I'll get back to you.
Re: programatically insert code
If you follow THIS Link, you will end up in another post on this subject. Follow the links referenced by Keystone Paul.
Hope that helps.