This project is read-only.
1
Vote

How to add new Project to Existing Solution in version 0.6.0.0

description

Hi,

I want to add the new Project to Existing Solution but it did not work
I am using the 0.6.0.0 version of Roslyn CTP

I am using Following Code

MSBuildWorkspace workspace = MSBuildWorkspace.Create();
        Microsoft.CodeAnalysis.Solution originalSolution = workspace.OpenSolutionAsync(obj.solution.Path).Result;
var projectId = ProjectId.CreateNewId();
        var versionStamp = VersionStamp.Create();
        var projectInfo = ProjectInfo.Create(projectId, versionStamp, "NewProject", "NewProject", LanguageNames.CSharp);
        originalSolution = originalSolution.AddProject(projectInfo);
        workspace.TryApplyChanges(originalSolution);
workspace.TryApplyChanges(originalSolution);


I got an Exception on the Line workspace.TryApplyChanges(originalSolution);
it says that {"Adding projects not supported in ApplyChanges."}

Please guide us as soon as possible

Regards

Rajesh Rai

comments

PauloMorgado wrote Mar 18, 2015 at 4:54 PM

The discussions on Roslyn have moved to https://github.com/dotnet/roslyn