18

I'm trying to find out why i'm not getting any help by omisharp in my visual studio code.

I've tried reinstalling both application and my extensions and i'm still having the problem.

Any ideas on what i might be missing? something I need to install?

// Alex

how it looks

Herlin
  • 353
  • 1
  • 5
  • 12
  • 1
    Immediately after you have opened your application in VS Code, open the Output window (View > Output) and choose the OmniSharp Log in the Output window. That will provide more information about what is happening. – Shaun Luttin May 13 '17 at 23:38
  • Thanks! I've found the problem, it had to do with MSBuild. Seems I fixed it! – Herlin May 14 '17 at 07:21
  • Glad to hear it. I have added my comment as an answer for posterity. – Shaun Luttin May 15 '17 at 04:41
  • @Herlin how did you fix the problem with MSBuild? – wuddadid Dec 04 '19 at 18:54
  • This happens to me when I open the solution folder, if I navigate to a specific project and open that folder, it all works – PandaWood Mar 28 '22 at 23:17

13 Answers13

24

OmniSharp works on the solution file. If the project is not added to a solution, then you will not see the errors.

Add project to the solution:

$ dotnet sln add SampleProject/SampleProject.csproj

Restart OmniSharp:

Press CTRL + SHIFT + P and select Omnisharp: Restart OmniSharp.

Tonatio
  • 4,026
  • 35
  • 24
  • I don't see how this can be true. When I open a specific project folder in VsCode, I see errors and it basically works. When I open the solution folder, which has a sln file with a reference to the same project, I see no errors and it basically doesn't work. So my problem is, omnisharp doesn't work when opening the solution – PandaWood Mar 28 '22 at 23:19
16

Immediately after you have opened your application in VS Code, open the Output window (View > Output) and choose the OmniSharp Log in the Output window. That will provide more information about what is happening.

Shaun Luttin
  • 133,272
  • 81
  • 405
  • 467
2

enter image description hereIt often happens because sometimes user by mistake disables the setting required for producing errors or problems. Just go to code > preferences > settings > Workspace settings and enable the required settings. It worked well for me, hope it does for you too.

2

I spent some time figuring this out. I tried uninstalling extensions, uninstalling vs code itself, removing all app data files etc. The only simple solution was to file\open folder and browse to one of the folders of code you were working with and from there recreate you work-space as before by adding additional folders if needed. Once I did this all intellisense and error detection came back including go to definition.

CodeMilian
  • 1,262
  • 2
  • 17
  • 41
2

I solved my same problem clicking in the bottom right corner of VSCode, line sequence CRLF, changed to LF and then change again to CRLF.

After this, my problem was solved, but i need to make this every time a restart the computer.

2

I fixed myself! all I did was press F1 and open settings(JSON), then I wrote "omnisharp.autoStart": true, give it a lil bit of time to load everything and you are done! Well this worked for me idk about you, but try it!

Saad EL
  • 21
  • 1
  • Glad you could fix it yourself, but probably best to put this in a comment under the original question and then resolve the answer. – Mina Oct 20 '21 at 12:36
1

If it helps! In my case I mistakenly disabled the ERROR SQUIGGLES, while writing C++ code.

enable_squiggles

You can enable them by navigating to FILE > PREFERENCES > SETTINGS.

Type squiggles (be accurate) and you will get that. Choose 'EnableIfIncludesResolve' or 'Enabled'. And

0

I spent so much time with this error. Finally, I tried the portable version of VS Code. It works well.

Here is the official guideline. https://code.visualstudio.com/docs/editor/portable

Bumuthu Dilshan
  • 430
  • 5
  • 14
0

First of all, check the OmniSharp Log in VS Code.

I've got this error:

Found dotnet version 3.1.412. Minimum required version is 6.0.100

Reason: I used .NET 3.1 but the latest OmniSharp (C# v1.25) requires at minimum .NET version 6.0.

Solution: I downgraded OmniSharp to v1.22 and it worked.

codewario
  • 19,553
  • 20
  • 90
  • 159
0

just download asp.net core 6. Then everything will be fine. That what I did and it is working perfectly

0

Click Ctl + Shift + P and Type "OmniSharp: Restart OmniSharp"

it will restart the Omnisharp and show Intelesense and Errors.

Hope It helps

0

Open Command Palette (ctrl+shift+p) , type Omnisharp , select Omnisharp: Analyze all projects ... It worked for me

0

If you getting the following error in VS Code...

Error!
.NET Acquisition Failed: Installation failed: Error: Command failed: powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "& { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 ; & 'c:\Users\91891\.vscode\extensions\ms-dotnettools.vscode-dotnet-runtime-1.6.0\dist\install scripts\dotnet-install.ps1' -InstallDir 'c:\Users\91891\AppData\Roaming\Code\User\globalStorage\ms-dotnettools.vscode-dotnet-runtime\.dotnet\7.0.10' -Version 7.0.10 -Runtime dotnet }
'powershell.exe' is not recognized as an internal or external command,
operable program or batch file.

Follow these steps to fix it:

  1. Add this line into environment varaibles (path)

    C:\Windows\System32\WindowsPowerShell\v1.0
    
  2. Restart VS Code.

Joshua Shew
  • 618
  • 2
  • 19