Today Microsoft open-sourced a new version of Roslyn and since this release is the first one in about a year and a half, there are an unsurprisingly large number of migration issues. (Symbol
-> ISymbol
, and basically every non-interface to an interface are predominant) However, I used to use:
Solution.LoadStandAloneProject(projectFile);
To obtain a solution that was created from a .csproj
file. (there were also static methods that consumed a .sln
file in the same way)
However, the new version, Microsoft.CodeAnalysis
does not have a Solution
class that contains any static methods. What is the correct method to call in the new API to achieve this functionality?
Kirill Osenkov provided the answer:
MSBuildWorkspace.Create().OpenSolutionAsync()
(I asked this question in all sincerity, but then Kirill provided this answer. Marking as CW since I'm just quoting him, but figured this might be useful to future visitors)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With