Example #1
0
 public virtual void CompileToFile(string dllPath, string pdbPath)
 {
     if (PreCompiler())
     {
         var compilation   = GetCompilation();
         var CompileResult = compilation.Emit(dllPath, pdbPath);
         if (CompileResult.Success)
         {
             Assembly = Domain.CompileFileHandler(dllPath, pdbPath, AssemblyName);
             FileCompileSucceedHandler?.Invoke(dllPath, pdbPath, compilation);
         }
         else
         {
             FileCompileFailedHandler?.Invoke(dllPath, pdbPath, CompileResult.Diagnostics, compilation);
         }
     }
 }
Example #2
0
        public virtual void CompileToFile()
        {
            if (PreCompiler())
            {
                var options = GetCompilationOptions();
                OptionAction?.Invoke(options);
                var compilation   = GetCompilation(options);
                var CompileResult = CompileEmitToFile(compilation);

                if (CompileResult.Success)
                {
                    AssemblyResult = Domain.CompileFileHandler(DllPath, PdbPath, AssemblyName);
                    FileCompileSucceedHandler?.Invoke(DllPath, PdbPath, compilation);
                }
                else
                {
                    FileCompileFailedHandler?.Invoke(DllPath, PdbPath, CompileResult.Diagnostics, compilation);
                }
            }
        }