Skip to content

Instantly share code, notes, and snippets.

@joymon
Created June 3, 2015 02:44
Show Gist options
  • Save joymon/5daaf5526f2c2ebb1d5f to your computer and use it in GitHub Desktop.
Save joymon/5daaf5526f2c2ebb1d5f to your computer and use it in GitHub Desktop.
private Compilation GetSimpleCompilation()
{
string source = GetSourceCode();
SyntaxTree tree = GetSyntaxTree(source);
IEnumerable<MetadataReference> referecnes = GetReferences();
return CSharpCompilation.Create("TestRoslynOutput",
syntaxTrees: new[] { tree },
references: referecnes,
options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment