示例#1
0
        protected Compilation GetCompilation(string code, MetadataReference[] references = null)
        {
            IEnumerable <SyntaxTree> syntaxTrees = SimpleParseUtil.Parse(code);

            references = references ?? SimpleCompileUtil.GetDefaultMetadataReferences();
            Compilation comp = SimpleCompileUtil.GetSimpleCSharpCompilation(syntaxTrees, references);

            return(comp);
        }
示例#2
0
        protected Compilation GetCompilation(FileInfo codePath, MetadataReference[] references = null)
        {
            SyntaxTree syntaxTrees = SimpleParseUtil.Parse(codePath);

            references = references ?? SimpleCompileUtil.GetDefaultMetadataReferences();
            Compilation comp = SimpleCompileUtil.GetSimpleCSharpCompilation(new [] { syntaxTrees }, references);

            return(comp);
        }