Omnisharp-vscode: Intellisense not working in C# extension of VS Code

Created on 6 Dec 2019  Â·  9Comments  Â·  Source: OmniSharp/omnisharp-vscode

Intellisense not working in C# extension of VS Code.
Every time I'll have to restart the VS Code and wait.
Sometimes Intellisense works and sometimes not.

Needs More Info Triaged

Most helpful comment

@sshankhdhar I see that OmniSharp is trying to run against the minimal MSBuild that we deploy with. This MSBuild wouldn't necessarily support all project types.

You can try installing the VS2019 Build Tools from https://visualstudio.microsoft.com/downloads/. Expand 'Tools for Visual Studio 2019' and download 'Build Tools for Visual Studio 2019'

All 9 comments

@sshankhdhar
Could you please provide a log from the Output window for Omnisharp Log target from your VSCode? It would help tremendously.
Thanks!

Hi Peter,

Please find attached Omnisharp logs.

0

Hi,

I'm using VS Code 1.40.2, installed OmniSharp 1.21.8 and also have visual studio 2019 professional on my machine, but the IntelliSense is not working for .net core project

    Starting OmniSharp on Windows 6.2.9200.0 (x64)
    DotNetPath set to dotnet
    Located 2 MSBuild instance(s)
        1: Visual Studio Professional 2019 16.1.29009.5 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin"
        2: StandAlone 16.3 - "c:\Users\Ben.Baloyi\.vscode\extensions\ms-vscode.csharp-1.21.8\.omnisharp\1.34.8\.msbuild\Current\Bin"
    Registered MSBuild instance: Visual Studio Professional 2019 16.1.29009.5 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin"
    Detecting Cake files in 'c:\Sandbox\NetworkManagerServices'.
    Could not find any Cake files
    Skip loading projects listed in solution file or under target directory because MsBuild:LoadProjectsOnDemand is true.
    Detecting CSX files in 'c:\Sandbox\NetworkManagerServices'.
    Could not find any CSX files
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
    Configuration finished.
    Omnisharp server running using Stdio at location 'c:\Sandbox\NetworkManagerServices' on host 856.
    Queue project update for 'c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj'
    Loading project: c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj
    The current .NET SDK does not support targeting .NET Core 3.1.  Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1.
    Failed to load project file 'c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj'.

c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj
C:\Program Files\dotnet\sdk\2.1.700\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): Error: The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1.

    Attempted to update project that is not loaded: c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj

Hi,

Mentioned path not found.
Below is the screenshot.

[cid:d8ae9876-7401-434b-adf3-f7d1d153356b]


From: Ben Kekana notifications@github.com
Sent: Thursday, December 12, 2019 5:42 PM
To: OmniSharp/omnisharp-vscode omnisharp-vscode@noreply.github.com
Cc: SHALABH SHANKHDHAR shankhdhar.shalabh@outlook.com; Mention mention@noreply.github.com
Subject: Re: [OmniSharp/omnisharp-vscode] Intellisense not working in C# extension of VS Code (#3443)

Hi,

Starting OmniSharp on Windows 6.2.9200.0 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Visual Studio Professional 2019 16.1.29009.5 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin"
2: StandAlone 16.3 - "c:\Users\Ben.Baloyi.vscode\extensions\ms-vscode.csharp-1.21.8.omnisharp\1.34.8.msbuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Professional 2019 16.1.29009.5 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin"
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Sandbox\NetworkManagerServices'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Skip loading projects listed in solution file or under target directory because MsBuild:LoadProjectsOnDemand is true.
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Sandbox\NetworkManagerServices'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Sandbox\NetworkManagerServices' on host 856.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj
fail: OmniSharp.MSBuild.ProjectLoader
The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1.
Failed to load project file 'c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj'.
c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj
C:\Program Files\dotnet\sdk\2.1.700\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): Error: The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1.

Attempted to update project that is not loaded: c:\Sandbox\NetworkManagerServices\NetworkManagerServices.csproj

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/OmniSharp/omnisharp-vscode/issues/3443?email_source=notifications&email_token=ALXJ5TYG45KFYPWZ5ARN7YDQYITEBA5CNFSM4JWRRSQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGWPBGI#issuecomment-564981913, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALXJ5T7CJ5YJBILEUZRJYJDQYITEBANCNFSM4JWRRSQQ.

@benitazz It appears your project is targeting .NET Core 3.1 but you are trying to run against .NET Core 2.1. Try running dotnet --info and installing the .NET Core 3.1 SDK if it isn't already.

@sshankhdhar I see that OmniSharp is trying to run against the minimal MSBuild that we deploy with. This MSBuild wouldn't necessarily support all project types.

You can try installing the VS2019 Build Tools from https://visualstudio.microsoft.com/downloads/. Expand 'Tools for Visual Studio 2019' and download 'Build Tools for Visual Studio 2019'

I was able to resolve my issue by installing the correct SDK of .net core

@sshankhdhar Thanks for filing this issue. Are you still seeing this problem? If so, could you share the following information:

  • The kind of project(s) you're attempting to use (.NET Framework, .NET Core, how many projects, etc.)
  • Any sharable repository

Thanks!

Closing out as no additional info was added.

Was this page helpful?
0 / 5 - 0 ratings