How can I prevent CompileAssemblyFromSource from leaking memory?
I think I have a working solution. Thanks to everyone for pointing me in the right direction (I hope). Assemblies can’t be unloaded directly, but AppDomains can. I created a helper library that gets loaded in a new AppDomain and is able to compile a new assembly from code. Here’s what the class in that … Read more