Exemplo n.º 1
0
        public static async Task <Assembly> CompileSubscribingAssembly(string code, string assName)
        {
            await Logger.Instance.ThrowOrLogNullLogEntry(code, "code");

            CompilerResults cr = CompilerHelper.CompileString(code, assName);

            if (cr.Errors.Count < 1)
            {
                return(cr.CompiledAssembly);
            }
            else
            {
                await Logger.Instance.LogManyAsync(
                    LogLevel.Error,
                    cr.Errors.Cast <CompilerError>().Select(ce => ce.ToString()));
            }

            return(null);
        }