我正在尝试使用MSBuildWorkspace类.我的项目中有所有程序集引用.当我在对象浏览器中打开引用时,我看到了命名空间和我尝试使用的类.但在我的以下使用声明中,
using Microsoft.CodeAnalysis.MSBuild
我得到了一个
The type or namespace name 'MSBuild' does not exist in the namespace 'Microsoft.CodeAnalysis' (are you missing an assembly reference?)
Run Code Online (Sandbox Code Playgroud)
但有趣的是,Syntax荧光笔识别出类型名称,它的编译器抱怨

这是构建日志
1>c:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3258: The primary reference "Microsoft.CodeAnalysis.Workspaces" could not be resolved because it has an indirect dependency on the .NET Framework assembly "Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which has a higher version "12.0.0.0" than the version "4.0.0.0" in the current target framework.
1>c:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3258: The primary reference "Microsoft.CodeAnalysis.VisualBasic.Workspaces" could not be resolved because …Run Code Online (Sandbox Code Playgroud)