Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not locate MSBuild instance to register with OmniSharp

I have found many questions about this but non have helped me. I am trying to write c# code and the omnisharp auto complete doesn't work and I get this back from the Omnisharp Log:

OmniSharp server started.
    Path: c:\Users\GeorgV.216\.vscode\extensions\ms-dotnettools.csharp-1.24.1\.omnisharp\1.38.3-beta.31\OmniSharp.exe
    PID: 11536

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
        Using the 'dotnet' on the PATH.
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 0 MSBuild instance(s)
Could not locate MSBuild instance to register with OmniSharp.

What could be a possible solution?

like image 595
Giorgos V Avatar asked Sep 07 '25 00:09

Giorgos V


1 Answers

As of May 2022, Omnisharp does not include MSBuild.

It can be installed with Build Tools for Visual Studio, found at the bottom of this page.

During install select .NET desktop build tools:

enter image description here

More info in this issue.

like image 64
Peter Hayman Avatar answered Sep 11 '25 02:09

Peter Hayman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!