Beispiel #1
0
        private RuntimeInstance CreateRuntime(
            string source,
            ImmutableArray <MetadataReference> compileReferences,
            ImmutableArray <MetadataReference> runtimeReferences)
        {
            var compilation0 = CreateCompilationWithMscorlib(
                source,
                options: TestOptions.DebugDll,
                assemblyName: ExpressionCompilerUtilities.GenerateUniqueName(),
                references: compileReferences);

            byte[] exeBytes;
            byte[] pdbBytes;
            ImmutableArray <MetadataReference> references;

            compilation0.EmitAndGetReferences(out exeBytes, out pdbBytes, out references);
            return(CreateRuntimeInstance(
                       ExpressionCompilerUtilities.GenerateUniqueName(),
                       runtimeReferences.AddIntrinsicAssembly(),
                       exeBytes,
                       SymReaderFactory.CreateReader(pdbBytes)));
        }
Beispiel #2
0
 private RuntimeInstance CreateRuntime(
     string source,
     ImmutableArray<MetadataReference> compileReferences,
     ImmutableArray<MetadataReference> runtimeReferences)
 {
     var compilation0 = CreateCompilationWithMscorlib(
         source,
         options: TestOptions.DebugDll,
         assemblyName: ExpressionCompilerUtilities.GenerateUniqueName(),
         references: compileReferences);
     byte[] exeBytes;
     byte[] pdbBytes;
     ImmutableArray<MetadataReference> references;
     compilation0.EmitAndGetReferences(out exeBytes, out pdbBytes, out references);
     return CreateRuntimeInstance(
         ExpressionCompilerUtilities.GenerateUniqueName(),
         runtimeReferences.AddIntrinsicAssembly(),
         exeBytes,
         new SymReader(pdbBytes));
 }