Yes, I kind of wanted something very weird, I said it. But it's only logical that it's not possible. That would mean to alter a dll in runtime... The decision I came up to go around this is using reflection. I send in a sort of a sandbox with variables that I might want to alter in the code, fetch the code from the file, encapsulate it inside a neat namespace with a class and a method, compile it, and run it. Seems to do the trick. I had to create a few "syntax hacks" to access the sandbox, like... $var as Label.Text = "something"; and in runtime replace the "pretty" line into something more ugly to access the sandbox. It works, and does the job very well. I also needed to create two more "syntax hacks" in case I need an extra reference, or to use an extra namespace that is not included by default in the assembly chunk. #assembly "System.Drawing.dll"; #using System.IO; Those three "hacks" are not very elegant, but... it allows me to have this done in a very generic way, which, in the current project, is the only way. Thank you all for the replies... and... if anyone as any thoughts on this, please let me know.
Gonçalo A.