Roslyn: How to get a reference to Workspace from currently loaded solution?

后端 未结 1 1029
半阙折子戏
半阙折子戏 2021-01-14 19:21

I am trying to get a reference to currently loaded workspace, without success. As per documentation (part in bold) I should be able to get a reference to it.

相关标签:
1条回答
  • 2021-01-14 19:25

    As described by Dustin Campbell in his answer here: How to work with Workspace.PrimaryWorkspace.CurrentSolution inside VSPackage

    The primary workspace inside of Visual Studio is only populated when the Roslyn C# and Visual Basic language services are enabled.

    To enable the Roslyn languages services you need to start your VS with the following command:

    devenv.exe /rootSuffix Roslyn
    
    0 讨论(0)
提交回复
热议问题