Omnisharp-vscode: C# not working, Omnisharp not starting

Created on 8 Mar 2020  路  11Comments  路  Source: OmniSharp/omnisharp-vscode

Issue Description

C# Intellisense not working. All of the C#, .NET, and Omnisharp logs are empty, and the Omnisharp icon not showing in the status bar

I tried removing .omnisharp and .vscode folders, turned off my firewall. But, no success

Steps to Reproduce

  1. Launch VS code
  2. Installing C# extension manually (.vsix file) (tried 1.21.13 1.21.12 1.21.11 all with the same result)
  3. C# log will show packages downloading, and after finishing the installing the packages the "Installing packages" icon will still be shown in the status bar, Omnisharp won't start
  4. Close and re-open VS code
  5. C#, Omnisharp, and .NET logs will all be empty. No Intellisense, and Omnisharp not starting

Expected Behavior

Omnisharp starting, and C# Intellisense working normally

Actual Behavior

Omnisharp not starting, C# Intellisense not working

Logs

Razor Log:

Razor.VSCode version 1.0.0-alpha3-5.0.0-preview.2.20120.8

Razor's trace level is currently set to 'Off'

  • To change Razor's trace level set 'razor.trace' to 'Off', 'Messages' or 'Verbose' and then restart VSCode.

- To report issues invoke the 'Report a Razor issue' command via the command palette.

[Client - 8:52:38 AM] No Razor files detected in workspace, delaying language server start.

OmniSharp log

EMPTY, literally there is nothing in the Omnisharp log

C# log

First time after installing the extension:
Installing C# dependencies...
Platform: win32, x86_64

Downloading package 'OmniSharp for Windows (.NET 4.6 / x64)' (32544 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for Windows (.NET 4.6 / x64)'

Downloading package '.NET Core Debugger (Windows / x64)' (41930 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (Windows / x64)'

Downloading package 'Razor Language Server (Windows / x64)' (50586 KB).................... Done!
Installing package 'Razor Language Server (Windows / x64)'

Finished

Other times:
Same as the Omnisharp log

Environment information

VSCode version: 1.42.1
C# Extension: 1.21.13

Dotnet Information
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26

Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100\

Host (useful for support):
Version: 3.0.0
Commit: 7d57652f33

.NET Core SDKs installed:
3.0.100 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download


Visual Studio Code Extensions

|Extension|Author|Version|
|---|---|---|
|csharp|ms-dotnettools|1.21.13|;

Resolved-External Triaged

Most helpful comment

What worked for me:

  1. F1 -> Open Settings(JSON)
  2. Find the "[csharp]" key
  3. Set the value of "editor.defaultFormatter" to "ms-dotnettools.csharp"

No such option exists in my Settings.JSON file however there was one in the defaultsettings.JSON but I couldn't modify any of the settings in the default settings file

All 11 comments

What worked for me:

  1. F1 -> Open Settings(JSON)
  2. Find the "[csharp]" key
  3. Set the value of "editor.defaultFormatter" to "ms-dotnettools.csharp"

Thanks for the report. Can you confirm that you have a C# file open when seeing this issue? Mentioning that IntelliSense failed to work sounds like it, but we don't want to assume anything here.

Thanks for the report. Can you confirm that you have a C# file open when seeing this issue? Mentioning that IntelliSense failed to work sounds like it, but we don't want to assume anything here.

Yes I do

What worked for me:

  1. F1 -> Open Settings(JSON)
  2. Find the "[csharp]" key
  3. Set the value of "editor.defaultFormatter" to "ms-dotnettools.csharp"

No such option exists in my Settings.JSON file however there was one in the defaultsettings.JSON but I couldn't modify any of the settings in the default settings file

I have the same problem, where no problems are discovered when there definately are problems and omni log is completely empty
I tried adding "editor.defaultFormatter": "ms-dotnettools.csharp" after "[csharp]": {}, but this also hasn't helped

Fresh install of vscode version 1.42
Extensions:
C# vs 1.21.14

Same issue here too...

Somewhat fixed my problem by uninstalling and reinstalling omnisharp.
now the server starts and finds errors but finds them at "off" places. (display error in the next line of where the error is/ if the error is at beginning of the line it displays the squiggly line at the end of the line)

Omnisharp starts if I open VSCode directly (outside of unity)
however, it does not stat is Unity starts VSCode...

@demidimi Thanks for that bit of information. Indeed opening a c# file from Unity does not open the folder containing the scripts but simply opens a file individually. The C# extension needs a folder to be open in order to find a .csproj or .sln file that provides additional details required to have a functional workspace.

image

Reported this issue via Unity "Report a Bug" functionality. Closing as Unity is opening us in an incomplete manner.

@JoeRobich I have this exact problem as Ghost described, even when launching VS Code directly and opening a folder. VSCode shows my folder where your screen shot says "NO FOLDER OPEN".

Just like Ghost described, all logs are completely empty.
I tried the fix as pmilkowski described and it didn't change anything.
I tried disabling and reinstalling all my extensions.
I tried a fresh install of VS Code.
I tried deleting my .VSCode folder in my repo. It does not get regenerated.

Was this page helpful?
0 / 5 - 0 ratings