Roslyn workspace.OpenSolutionAsync().Projects always empty? -


I'm trying to create a self-hosted WebAPI 2.0 project that lets you open / explore / build .sln solutions Allows an API to open.

Here is the code within one of my controllers, which is the list of projects. The SLN is given a path:

  public async Tasks & lt; IHttpActionResult & gt; GetProjects (string slnPath = "") {var workspace = MSBuildWorkspace.Create (); Var solution = awaiting workstation. OpenSolutionSync (SLNPath); Var projects = solution. Project; }  

I hope to keep projects in solutions, but according to Debugger, solution.Projects and solution.ProjectIds Always appears empty.

I have tried to do this with multiple .sln files, all I can open in Visual Studio and see that they have projects.

I have seen, but my project does not add to the visual studio, it is a library called a command line application.

In general, in the order of equality, one of the few things is:

  1. You have lost copies of Microsoft CodeAnalysis.CSharp.Workspaces.dll or Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll. Make sure that when you are running your project, that's the main DLLs main Microsoft.CodeAnalysis.Workspaces.dll is near.

  2. You are loading solutions with project types that we do not support. We should support any project type except project-less web site projects. Class libraries should work fine.

  3. We have a bug that we have to handle your particular project types incorrectly, if so, file a bug.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -