【发布时间】:2017-03-04 12:40:26
【问题描述】:
所以,我是 C# 和 Net Core 的新手,有人将代码传递给了评估命令。 但是不是Net Core做的,所以Net Core中不存在AppDomain,怎么办?
ScriptOptions so = ScriptOptions.Default;
so = so.WithImports(new string[] { "System.Math", "System.Diagnostics", "System.Runtime.InteropServices",
"Discord.WebSocket", "Discord.Commands", "Discord", "System.Threading.Tasks", "System.Linq", "System", "System.Collections.Generic", "System.Convert", "System.Reflection"});
so = so.WithReferences(AppDomain.CurrentDomain.GetAssemblies().Where(xa => !xa.IsDynamic && !string.IsNullOrWhiteSpace(xa.Location)));
【问题讨论】:
标签: c# reflection .net-core