Omnisharp uses the wrong solution to load

We have similar issue. Omnisharp crash is as follow:

Omnisharp: [WARNING] Task attempted to find "AxImp.exe" in two locations. 1) Under the "/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/4.5/" processor specific directory which is generated based on SdkToolsPath 2) The x86 specific directory under "/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/4.5/" which is specified by the SDKToolsPath property. You may be able to solve the problem by doing one of the following:  1) Set the "SDKToolsPath" property to the location of the Microsoft Windows SDK.
Omnisharp: [ERROR] Task could not find "AxImp.exe" using the SdkToolsPath "/Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/4.5/" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.8\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed

Interesting thing is I have solution file opened that doesn’t event include this project on which Omnisharp fails since we have some projects in source control that compile only on Windows, so we have separate solution to develop on Mac which contains only those projects that build properly on Mac.

Here is the stacktrace:

=================================================================
	Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x1155ef7cd):0x1155ef7bd  f8 4d 8b f7 4d 8b e6 4d 85 f6 0f 84 46 00 00 00  .M..M..M....F...
0x1155ef7cd  49 8b 1e 49 8b 46 10 48 85 c0 0f 85 33 00 00 00  I..I.F.H....3...
0x1155ef7dd  0f b6 43 2c 48 83 f8 01 75 29 48 8b 03 48 8b 58  ..C,H...u)H..H.X
0x1155ef7ed  08 8b 43 60 48 3d a7 0b 00 00 72 17 48 8b 43 78  ..C`H=....r.H.Cx

=================================================================
	Managed Stacktrace:
=================================================================
	  at Microsoft.Build.BackEnd.TaskExecutionHost:GetItemOutputs <0x0007d>
	  at Microsoft.Build.BackEnd.TaskExecutionHost:Microsoft.Build.BackEnd.ITaskExecutionHost.GatherTaskOutputs <0x00222>
	  at Microsoft.Build.BackEnd.TaskBuilder:GatherTaskOutputs <0x004b6>
	  at <ExecuteInstantiatedTask>d__26:MoveNext <0x0203a>
	  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
	  at Microsoft.Build.BackEnd.TaskBuilder:ExecuteInstantiatedTask <0x0019a>
	  at <InitializeAndExecuteTask>d__24:MoveNext <0x00162>
	  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000f2>
	  at Microsoft.Build.BackEnd.TaskBuilder:InitializeAndExecuteTask <0x0019a>
	  at <ExecuteBucket>d__19:MoveNext <0x00832>
	  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
	  at Microsoft.Build.BackEnd.TaskBuilder:ExecuteBucket <0x0016a>
	  at <ExecuteTask>d__18:MoveNext <0x0068a>
	  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
	  at Microsoft.Build.BackEnd.TaskBuilder:ExecuteTask <0x00112>
	  at <ExecuteTask>d__13:MoveNext <0x005ea>
	  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
	  at Microsoft.Build.BackEnd.TaskBuilder:ExecuteTask <0x00262>
	  at <ProcessBucket>d__51:MoveNext <0x001f5>
	  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x000fa>
	  at Microsoft.Build.BackEnd.TargetEntry:ProcessBucket <0x001ba>
	  at <ExecuteTarget>d__44:MoveNext <0x00d7a>
	  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x000fa>
	  at Microsoft.Build.BackEnd.TargetEntry:ExecuteTarget <0x00172>
	  at <ProcessTargetStack>d__23:MoveNext <0x00f02>
	  at MoveNextRunner:InvokeMoveNext <0x000b0>
	  at System.Threading.ExecutionContext:RunInternal <0x001a9>
	  at System.Threading.ExecutionContext:Run <0x00042>
	  at MoveNextRunner:Run <0x000b9>
	  at <>c:<Run>b__2_0 <0x00058>
	  at System.Threading.Tasks.Task:InnerInvoke <0x0008f>
	  at System.Threading.Tasks.Task:Execute <0x00037>
	  at System.Threading.Tasks.Task:ExecutionContextCallback <0x0005b>
	  at System.Threading.ExecutionContext:RunInternal <0x001a9>
	  at System.Threading.ExecutionContext:Run <0x00042>
	  at System.Threading.Tasks.Task:ExecuteWithThreadLocal <0x000f6>
	  at System.Threading.Tasks.Task:ExecuteEntry <0x000e8>
	  at System.Threading.Tasks.TaskScheduler:TryExecuteTask <0x00043>
	  at DedicatedThreadsTaskScheduler:<InjectThread>b__6_0 <0x000c2>
	  at System.Threading.ThreadHelper:ThreadStart_Context <0x000aa>
	  at System.Threading.ExecutionContext:RunInternal <0x001a9>
	  at System.Threading.ExecutionContext:Run <0x00042>
	  at System.Threading.ExecutionContext:Run <0x00067>
	  at System.Threading.ThreadHelper:ThreadStart <0x00042>
	  at System.Object:runtime_invoke_void__this__ <0x000b0>
=================================================================
Error executing sensor: 'OmniSharp'
java.lang.IllegalStateException: Unable to start OmniSharp
	at org.sonarsource.sonarlint.omnisharp.OmnisharpSensor.execute(OmnisharpSensor.java:102)
	at org.sonarsource.sonarlint.core.analysis.container.analysis.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:81)
	at org.sonarsource.sonarlint.core.analysis.container.analysis.sensor.SensorsExecutor.execute(SensorsExecutor.java:72)
	at org.sonarsource.sonarlint.core.analysis.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:122)
	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.startComponents(ComponentContainer.java:119)
	at org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer.execute(ComponentContainer.java:104)
	at org.sonarsource.sonarlint.core.analysis.container.module.ModuleContainer.analyze(ModuleContainer.java:71)
	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(AnalyzeCommand.java:58)
	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(AnalyzeCommand.java:32)
	at org.sonarsource.sonarlint.core.analysis.AnalysisEngine$AsyncCommand.execute(AnalysisEngine.java:150)
	at org.sonarsource.sonarlint.core.analysis.AnalysisEngine.executeQueuedCommands(AnalysisEngine.java:70)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.IllegalStateException: Timeout waiting for solution/project configuration to be loaded
	at org.sonarsource.sonarlint.omnisharp.OmnisharpServer.doStart(OmnisharpServer.java:198)
	at org.sonarsource.sonarlint.omnisharp.OmnisharpServer.lazyStart(OmnisharpServer.java:148)
	at org.sonarsource.sonarlint.omnisharp.OmnisharpSensor.execute(OmnisharpSensor.java:96)
	... 11 more

Hi @malczu

I moved your post to a new one, since I think the error is different.
If I understand correctly:

  • your have multiple .sln files at the root of your projects. One is for Windows, and another one is for Mac.
  • when you open Rider, you select one specific .sln, but Omnisharp is taking another one (should be visible in the SonarLint logs)

Am I correct?

Just to confirm, can you temporarily delete the .sln files that you don’t use, and restart Rider, to foce OmniSharp to pick the right one. Do you see issues reported now?

Hey. You are correct. I have deleted other sln file as you advised and it worked. I use MyProject.Mac.sln and the other one was MyProject.sln. Both sln files were in the same folder.

1 Like

Thanks for the confirmation. We already have a ticket for this issue that you can track:
https://jira.sonarsource.com/browse/SLI-628

I will see how we can have this prioritized.

1 Like