1

I'm trying to get auto-completion with Unity, and I keep getting this message:

Starting OmniSharp server at 12/28/2021, 4:12:57 AM
    Target: d:\UnityHub\Igor\Igor.sln

OmniSharp server started.
    Path: c:\Users\james\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.37.17\OmniSharp.exe
    PID: 21752

[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
System.IO.FileNotFoundException: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.dll
   at System.Diagnostics.FileVersionInfo.GetVersionInfo(String fileName)
   at OmniSharp.MSBuild.Discovery.MSBuildInstanceProvider.GetMSBuildVersion(String microsoftBuildPath) in D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\MSBuildInstanceProvider.cs:line 104
   at OmniSharp.MSBuild.Discovery.Providers.MicrosoftBuildLocatorInstanceProvider.<>c.<GetInstances>b__1_0(VisualStudioInstance instance) in D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\Providers\MicrosoftBuildLocatorInstanceProvider.cs:line 30
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
   at OmniSharp.MSBuild.Discovery.MSBuildLocator.GetInstances() in D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\MSBuildLocator.cs:line 115
   at OmniSharp.MSBuild.Discovery.Extensions.GetBestInstance(IMSBuildLocator msbuildLocator, Version minimumMSBuildVersion, ILogger logger, Boolean& invalidVSFound, Boolean& vsWithoutSdkResolver) in D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\Extensions.cs:line 109
   at OmniSharp.MSBuild.Discovery.Extensions.RegisterDefaultInstance(IMSBuildLocator msbuildLocator, ILogger logger, DotNetInfo dotNetInfo) in D:\a\1\s\src\OmniSharp.Host\MSBuild\Discovery\Extensions.cs:line 17
   at OmniSharp.CompositionHostBuilder.Build(String workingDirectory) in D:\a\1\s\src\OmniSharp.Host\CompositionHostBuilder.cs:line 71
   at OmniSharp.Stdio.Host..ctor(TextReader input, ISharedTextWriter writer, IOmniSharpEnvironment environment, IServiceProvider serviceProvider, CompositionHostBuilder compositionHostBuilder, ILoggerFactory loggerFactory, CancellationTokenSource cancellationTokenSource) in D:\a\1\s\src\OmniSharp.Stdio\Host.cs:line 49
   at OmniSharp.Stdio.Driver.Program.<>c__DisplayClass0_1.<Main>b__1() in D:\a\1\s\src\OmniSharp.Stdio.Driver\Program.cs:line 74
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass146_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<ExecuteAsync>d__157.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at OmniSharp.HostHelpers.Start(Func`1 action) in D:\a\1\s\src\OmniSharp.Host\HostHelpers.cs:line 29

I'm not really sure what's going on, but I installed Visual Studio as well and that also failed as a solution.

2
  • Hi, I also face this issue. Did you solve this? Commented Dec 31, 2021 at 11:43
  • I somewhat "solved" it, I ended up just reinstalling Windows. Commented Jan 20, 2022 at 5:36

1 Answer 1

3

I had the same problem, I got this from this reddit post: https://www.reddit.com/r/vscode/comments/ooyijp/issue_with_omnisharpc_extension/

"You'll need to tell VS Code to only use the bundled MSBuild version that comes with omnisharp. per https://github.com/OmniSharp/omnisharp-vscode/issues/4358

you can add omnisharp.json to the root of your workspace with the following content

{ "msbuild": { "useBundledOnly": true } }

For global effect, the file can be put into %USERPROFILE%/.omnisharp/"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.