OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 168 forks source link

How to use Omnisharp with Dotnet SDK 8? #859

Closed VitorCioletti closed 9 months ago

VitorCioletti commented 9 months ago

System: Ubuntu 22.04.3 LTS (WLS on Windows 10) VIM: 8.2 (2019 Dec 12, compiled Dec 05 2023 17:58:57) Dotnet: 8.0.102 (which comes with MSBuild 17.8.5) Mono installed: 6.12.0.200

This is my first time installing vim plugins to use it in development as a full editor (so I am not sure exactly what I am doing). I would like to make it work with dotnet SDK 8 but I can't find a solution to make a simple project to work.

My problem is that I get false compilation errors that does not appear when I run "dotnet build".

image

I downgraded my dotnet to 6.0 and this same project worked fine. I believe it has something to do with MSBuild version as stated in the line 19.

This is what basically my .vimrc looks like.

image

Is this even supposed to work?

Thanks.

nickspoons commented 9 months ago

Try adding let g:OmniSharp_server_use_net6 = 1 to your .vimrc, it should really be the default these days but I'm nervous about breaking backwards compatibility.

I'm not sure if that warning about msbuild version will still be an issue. If there are still problems, please post the full log from :OmniSharpOpenLog, not a screenshot of part of it.

VitorCioletti commented 9 months ago

It worked fine. Thanks.