OmniSharp / omnisharp-vim

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

Could not locate MSBuild instance to register with OmniSharp #792

Closed Kaoruha closed 2 years ago

Kaoruha commented 2 years ago

Hello, I have installed omnisharp-vim with plug-vim. And success installed omnisharp-roslyn. But when the server start, it shows the message as title.

Logs like this:

8 ¦ Starting OmniSharp on kali 2022.2 (x64) 9 info: OmniSharp.Services.DotNetCliService 10 ¦ Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK 11 info: OmniSharp.Services.DotNetCliService 12 ¦ Using the 'dotnet' on the PATH. 13 info: OmniSharp.Services.DotNetCliService 14 ¦ DotNetPath set to dotnet 15 info: OmniSharp.MSBuild.Discovery.MSBuildLocator 16 ¦ Located 0 MSBuild instance(s)

I have installed dotnet and mono.

dotnet msbuild -h Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET Copyright (C) Microsoft Corporation. All rights reserved.

mono --version Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-3.2 Tue Jun 29 21:01:01 UTC 2021) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

What should i do to solve this problem?

nickspoons commented 2 years ago

If your project is a .net core project, try using the net6 version of the server. Installation steps described here: https://github.com/OmniSharp/omnisharp-vim/issues/791#issuecomment-1170502526

Kaoruha commented 2 years ago

If your project is a .net core project, try using the net6 version of the server. Installation steps described here: #791 (comment)

Thanks. The problem solved after setting "g:OmniSharp_server_use_net6 = 1" and reinstall the omnisharp server.