.NET application I work on allows to extend it's functionality with C# scripts that are put into configuration file and compiled like that:
CodeDomProvider provider;
...
var result = provider.CompileAssemblyFromSource(prms, new[] { scriptCode });
var asm = result.CompiledAssembly;
var t = asm.GetType("ScriptClass");
var scriptInstance = (IScript)Activator.CreateInstance();
I have to allow users to change configuration file, catch this event and recompile scripts in runtime without application restart.
I'm warned that previous code will still utilize memory. How should I unload compiled code?
Thank you in advance!