- Roslyn
安裝Microsoft.CodeAnalysis.CSharp.Scripting
using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;
string code = "int result = 1 + 2; Console.WriteLine(result);";
var options = ScriptOptions.Default.WithImports("System");
var script = CSharpScript.Create(code, options);
script.RunAsync().Wait();
[參考]
https://blog.csdn.net/weixin_30802273/article/details/99274776