The MSBuildWorspace
is built around the concept of handling MSBuild solutions (.sln
files) and their respective projects (.csproj
, .vbproj
).
Adding new projects and documents to this workspace is not supported.
string solutionPath = @"C:\Path\To\Solution\Sample.sln";
MSBuildWorkspace workspace = MSBuildWorkspace.Create();
Solution solution = await workspace.OpenSolutionAsync(nancyApp);
var allDocumentsInSolution = solution.Projects.SelectMany(x => x.Documents);