/// <summary> /// Compiles the provided syntax tree, and loads and returns the result. /// </summary> /// <param name="generatedSyntax">The syntax tree.</param> /// <returns>The compilation output.</returns> private static byte[] CompileAndLoad(GeneratedSyntax generatedSyntax) { var rawAssembly = CodeGeneratorCommon.CompileAssembly(generatedSyntax, "OrleansCodeGen.dll"); Assembly.Load(rawAssembly); return(rawAssembly); }
/// <summary> /// Compiles the provided syntax tree, and loads and returns the result. /// </summary> /// <param name="generatedSyntax">The syntax tree.</param> /// <param name="emitDebugSymbols"> /// Whether or not to emit debug symbols for the generated assembly. /// </param> /// <returns>The compilation output.</returns> private static CachedAssembly CompileAndLoad(GeneratedSyntax generatedSyntax, bool emitDebugSymbols) { var generated = CodeGeneratorCommon.CompileAssembly(generatedSyntax, "OrleansCodeGen", emitDebugSymbols: emitDebugSymbols); Assembly.Load(generated.RawBytes, generated.DebugSymbolRawBytes); return(new CachedAssembly(generated) { Loaded = true }); }
/// <summary> /// Compiles the provided syntax tree, and loads and returns the result. /// </summary> /// <param name="generatedSyntax">The syntax tree.</param> /// <param name="emitDebugSymbols"> /// Whether or not to emit debug symbols for the generated assembly. /// </param> /// <returns>The compilation output.</returns> private static CachedAssembly CompileAndLoad(GeneratedSyntax generatedSyntax, bool emitDebugSymbols) { var generated = CodeGeneratorCommon.CompileAssembly(generatedSyntax, "OrleansCodeGen", emitDebugSymbols: emitDebugSymbols); var loadedAssembly = LoadAssembly(generated); return(new CachedAssembly(generated) { Loaded = true, Assembly = loadedAssembly, }); }