RoslynAssembly
this is a sample that describes how to dynamically compile snippets of C# code int net modules using Roslyn and assemble them together into a dynamic assembly. This is the code for the article https://www.codeproject.com/Articles/1215168/Using-Roslyn-for-Compiling-Code-into-Separate-Net
Note that the net modules were not included into .NET CORE so this approach will not work under .NET core!!!