I am experiencing with Roslyn on a .NET Core console application. I tried to create an assembly and compile it into a memory stream. But loading it seems to be missing an API (that normally works on the regular .NET Framework)
var compilation = CSharpCompilation.Create("MyCompilation",
syntaxTrees: new[] { pocoTree }, references: new[] { mscorlib, currentAssembly });
var ms = new MemoryStream();
var emitResult = compilation.Emit(ms);
var ourAssembly = Assembly.Load(ms.ToArray()); // Fails to compile here
I get this error:
cannot convert from 'byte[]' to 'System.Reflection.AssemblyName'
What is the alternative in .NET Core to load from a steam? (other than physically saving the assembly and loading it)