dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.84k stars 663 forks source link

OmniSharp server doesn't start ([ERROR] Error: command 'dotnet.test.run' already exists) #3572

Open emin2105 opened 4 years ago

emin2105 commented 4 years ago

Cannot use C# in my unity project because omnisharp server doesn't start

The same issue was described in #2952 and has been closed earlier but the problem still appears

OmniSharp version 1.34.11

OmniSharp server started.
    Path: C:\Users\Emin\.vscode\extensions\ms-vscode.csharp-1.21.11\.omnisharp\1.34.11\OmniSharp.exe
    PID: 13516

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Visual Studio Enterprise 2019 16.4.29613.14 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
            2: StandAlone 16.3 - "C:\Users\Emin\.vscode\extensions\ms-vscode.csharp-1.21.11\.omnisharp\1.34.11\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Enterprise 2019 16.4.29613.14 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'c:\Users\Emin\Unity\Repos\PPrototype'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in 'c:\Users\Emin\Unity\Repos\PPrototype\PPrototype.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Users\Emin\Unity\Repos\PPrototype\Assembly-CSharp.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\Users\Emin\Unity\Repos\PPrototype\Assembly-CSharp-Editor.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\Users\Emin\Unity\Repos\PPrototype'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\Users\Emin\Unity\Repos\PPrototype\Assembly-CSharp.csproj
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\Users\Emin\Unity\Repos\PPrototype' on host 19116.
[ERROR] Error: command 'dotnet.test.run' already exists
filipw commented 4 years ago

does this happen when you disable all other extensions?

emin2105 commented 4 years ago

Disabled all other extensions and it worked, ty. Yet still it's not clear what exactly causes the problem, need to enable them one by one now.

emin2105 commented 4 years ago

Well, it seems that this has something to do with the vscode-solution-explorer extension, which is not very good since it's a very useful extension to work with dotnet projects and there was no problem with it so far. Disabling it will solve the problem, so apparently they are somehow incompatible now.

filipw commented 4 years ago

then I think you should open an issue there 😀

lprichar commented 4 years ago

fwiw I just got this error and do not have the vscode-solution-explorer extension. I disabled all my extensions and re-enabled them one-by-one and the error resolved itself :|. Maybe a race condition with some other plugin? Here are my plugins in case it helps someone else diagnose which ones were conflicting:

marcusoftnet commented 4 years ago

For what it's worth, the issue is pretty old, I reinstalled the C# plugin and then it started to work again.