tina nyaa
tina nyaa

Reputation: 1021

add project to solution not applying with roslyn?

I'm trying to do basic things with Roslyn but failing really hard. I am stuck trying to add a project to a solution - when I try to add a project to a solution / workspace, it does not apply and the project count remains zero.

Here is my current code. How am I screwing up with something so basic?

var workspace = new CustomWorkspace(MefHostServices.DefaultHost);
var project = workspace.CurrentSolution.AddProject("[name]", "__assemblyName__", LanguageNames.CSharp);

workspace.TryApplyChanges(project.Solution); // i have tried it with and without this line

var projectCount = workspace.CurrentSolution.Projects.Count(); // is still zero

Upvotes: 3

Views: 860

Answers (1)

Jason Malinowski
Jason Malinowski

Reputation: 19021

This was a bug that we fixed a month and a half ago, but there hasn't been a new NuGet release with the fix yet. The next update to the packages will contain the fix.

Upvotes: 2

Related Questions