vscode-csharp: MSBuild does not locate targets for MonoGame

Environment data

dotnet --info output:

ambs@diabelli CourseCSharp $ dotnet --info
.NET Command Line Tools (1.0.1)

Product Information:
 Version:            1.0.1
 Commit SHA-1 hash:  005db40cd1

Runtime Environment:
 OS Name:     linuxmint
 OS Version:  18.1
 OS Platform: Linux
 RID:         ubuntu.16.04-x64
 Base Path:   /usr/share/dotnet/sdk/1.0.1

VS Code version: $ code --version 1.11.2 6eaebe3b9c70406d67c97779468c324a7a95db0e

C# Extension version: 1.8.1

Steps to reproduce

I open code with a standard C# hello world project, write ‘Console.’ and no completion is shown.

Expected behavior

Expected the list of available methods from the System.Console class

Actual behavior

none.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 30 (16 by maintainers)

Most upvoted comments

Yup. OK. Here’s a workaround for you. It’s not great, but’ll get your project working. Add an “omnisharp.json” file to the directory that you’re opening in VS Code with the following content:

{
    "msbuild": {
        "MSBuildExtensionsPath": "/usr/lib/mono/xbuild"
    }
}

Be sure to keep that file in the root folder that you open in VS Code and it should get things working for you.