Example #1
0
        private IProject CreateSubmissionProject(ISolution solution)
        {
            var name      = "Submission#" + _documentNumber++;
            var projectId = ProjectId.CreateNewId(solution.Id, name);

            var version            = VersionStamp.Create();
            var compilationOptions = _compilationOptions.WithScriptClassName(name);

            var projectInfo = new ProjectInfo(
                projectId,
                version,
                name,
                name,
                LanguageNames.CSharp,
                compilationOptions: compilationOptions,
                parseOptions: _parseOptions,
                metadataReferences: _references,
                isSubmission: true);

            solution = solution.AddProject(projectInfo);

            if (_previousProjectId != null)
            {
                solution = solution.AddProjectReference(projectId, _previousProjectId);
            }

            return(solution.GetProject(projectId));
        }
Example #2
0
        private IProject CreateSubmissionProject(ISolution solution)
        {
            string    name = "Submission#" + _documentNumber++;
            ProjectId id   = ProjectId.CreateNewId(solution.Id, name);

            solution =
                solution.AddProject(new ProjectInfo(id, VersionStamp.Create(), name, name, LanguageNames.CSharp, null,
                                                    _compilationOptions.WithScriptClassName(name), _parseOptions, null,
                                                    null, _references, null, true));
            if (_previousProjectId != null)
            {
                solution = solution.AddProjectReference(id, _previousProjectId);
            }
            return(solution.GetProject(id));
        }
Example #3
0
        private IProject CreateSubmissionProject(ISolution solution)
        {
            var name = "Submission#" + _documentNumber++;
            var projectId = ProjectId.CreateNewId(solution.Id, name);

            var version = VersionStamp.Create();
            var compilationOptions = _compilationOptions.WithScriptClassName(name);

            var projectInfo = new ProjectInfo(
                projectId,
                version,
                name,
                name,
                LanguageNames.CSharp,
                compilationOptions: compilationOptions,
                parseOptions: _parseOptions,
                metadataReferences: _references,
                isSubmission: true);

            solution = solution.AddProject(projectInfo);

            if (_previousProjectId != null)
            {
                solution = solution.AddProjectReference(projectId, _previousProjectId);
            }

            return solution.GetProject(projectId);
        }