protected void UpdateCompilation(string docName, string code) { Document newDoc = TheWorkspace.AddDocument(docName, code); this.TheProj = TheWorkspace.CurrentProj; SyntaxTree syntaxTree = newDoc.GetSyntaxTreeAsync().Result; TheCompilation = TheCompilation.AddSyntaxTrees(syntaxTree); }
internal void CreateProject() { TheWorkspace.ClearSolution(); ProjectInfo projInfo = ProjectInfo.Create ( TheProjId, VersionStamp.Create(), ProjName, AssemblerNames.GENERATED_NAMESPACE_NAME, LanguageNames.CSharp, parseOptions: TheParseOptions, compilationOptions: TheAssemblyCompilationsOptions ); TheProj = TheWorkspace.AddProject(projInfo); TheCompilation = TheWorkspace.CurrentProj.GetCompilationAsync().Result; }