Exemplo n.º 1
0
        private Project CreateSubmissionProject(Solution solution, CSharpCompilationOptions compilationOptions, Project previousProject)
        {
            var name = "Program" + _documentNumber++;
            var id   = ProjectId.CreateNewId(name);

            solution = solution.AddProject(ProjectInfo.Create(
                                               id,
                                               VersionStamp.Create(),
                                               name,
                                               name,
                                               LanguageNames.CSharp,
                                               isSubmission: true,
                                               parseOptions: _parseOptions,
                                               compilationOptions: compilationOptions.WithScriptClassName(name),
                                               metadataReferences: previousProject != null ? ImmutableArray <MetadataReference> .Empty : DefaultReferences));

            var project = solution.GetProject(id);

            if (previousProject != null)
            {
                project = project.AddProjectReference(new ProjectReference(previousProject.Id));
            }

            return(project);
        }
Exemplo n.º 2
0
        private Project CreateSubmissionProject(Solution solution, CSharpCompilationOptions compilationOptions)
        {
            var name = "Program" + _documentNumber++;
            var id   = ProjectId.CreateNewId(name);

            solution = solution.AddProject(ProjectInfo.Create(id, VersionStamp.Create(), name, name, LanguageNames.CSharp,
                                                              parseOptions: _parseOptions,
                                                              compilationOptions: compilationOptions.WithScriptClassName(name),
                                                              metadataReferences: DefaultReferences));
            return(solution.GetProject(id));
        }
Exemplo n.º 3
0
        private Project CreateSubmissionProject(Solution solution)
        {
            string    name = "Program" + 1;
            ProjectId id   = ProjectId.CreateNewId(name);

            solution = solution.AddProject(ProjectInfo.Create(id, VersionStamp.Create(), name, name, LanguageNames.CSharp,
                                                              parseOptions: _parseOptions,
                                                              compilationOptions: _compilationOptions.WithScriptClassName(name),
                                                              metadataReferences: _references));

            return(solution.GetProject(id));
        }
Exemplo n.º 4
0
        private Project CreateSubmissionProject(Solution solution)
        {
            string    name = "Program" + _documentNumber++;
            ProjectId id   = ProjectId.CreateNewId(name);

            solution = solution.AddProject(ProjectInfo.Create(id, VersionStamp.Create(), name, name, LanguageNames.CSharp,
                                                              parseOptions: _parseOptions,
                                                              compilationOptions: _compilationOptions.WithScriptClassName(name),
                                                              metadataReferences: _references));
            //if (_previousProjectId != null)
            //{
            //    solution = solution.AddProjectReference(id, new ProjectReference(_previousProjectId));
            //}
            return(solution.GetProject(id));
        }