What happened to "Solution.LoadStandAloneProject" in the new version of Roslyn (Microsoft.CodeAnalysis)?

Today, Microsoft opened the new version of Roslyn, and since this release is the first of about a year and a half, there are a huge number of migration problems. ( SymbolISymbol, and basically every non-interface for the interface is predominant). However, I used:

Solution.LoadStandAloneProject(projectFile);

To get a solution created from a file .csproj. (there were also static methods that consumed the file .slnin the same way)

However, the new version Microsoft.CodeAnalysisdoes not have a class Solutionthat contains any static methods. What is the correct method to call the new API to achieve this functionality?

+4
source share
1 answer

Kirill Osenkov provided the answer:

MSBuildWorkspace.Create().OpenSolutionAsync()

(I asked this question with all sincerity, but then Cyril provided this answer. Noting as CW, since I just quote it, but thought it might be useful for future visitors)

+10
source

Source: https://habr.com/ru/post/1534953/


All Articles