Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OmniSharp fails to load when the path provided contains spaces. #5150

Closed
ghost opened this issue Apr 3, 2022 · 3 comments · Fixed by #5154
Closed

OmniSharp fails to load when the path provided contains spaces. #5150

ghost opened this issue Apr 3, 2022 · 3 comments · Fixed by #5154

Comments

@ghost
Copy link

ghost commented Apr 3, 2022

Environment data

dotnet --info output:

.NET SDK (reflecting any global.json):
 Version:   6.0.201     
 Commit:    ef40e6aa06  

Runtime Environment:    
 OS Name:     Windows   
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.201\

Host (useful for support):
  Version: 6.0.3
  Commit:  c24d9a9c91

.NET SDKs installed:
  6.0.200 [C:\Program Files\dotnet\sdk]
  6.0.201 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

VS Code version:
VSCode 1.66.0

C# Extension version:
Current latest as 4/3/22 (UTC -0300), that is v1.24.3

OmniSharp log

Starting OmniSharp server at 4/3/2022, 7:10:00 PM
    Target: c:\Users\Dottik\source\repos\Test Project\Test Project.sln

OmniSharp server started with .NET 6.0.201
.
    Path: c:\Users\Dottik\.vscode\extensions\ms-dotnettools.csharp-1.24.3-win32-x64\.omnisharp\1.38.2-net6.0\OmniSharp.dll
    PID: 7896

System.ArgumentException: OmniSharp only supports being launched with a directory path or a path to a solution (.sln, .slnf) file. (Parameter 'path')
   at OmniSharp.Services.OmniSharpEnvironment..ctor(String path, Int32 hostPid, LogLevel logLevel, String[] additionalArguments) in D:\a\1\s\src\OmniSharp.Host\Services\OmniSharpEnvironment.cs:line 38
   at OmniSharp.CommandLineApplicationExtensions.CreateEnvironment(CommandLineApplication application) in D:\a\1\s\src\OmniSharp.Host\CommandLineApplicationExtensions.cs:line 12
   at OmniSharp.Stdio.Driver.Program.<>c__DisplayClass0_1.<Main>b__1() in D:\a\1\s\src\OmniSharp.Stdio.Driver\Program.cs:line 49
   at OmniSharp.CommandLineApplication.<>c__DisplayClass12_0.<OnExecute>b__0() in D:\a\1\s\src\OmniSharp.Host\CommandLineApplication.cs:line 92
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass146_0.<OnExecute>b__0(CancellationToken _)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
   at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at OmniSharp.CommandLineApplication.Execute(String[] args) in D:\a\1\s\src\OmniSharp.Host\CommandLineApplication.cs:line 65
   at OmniSharp.Stdio.Driver.Program.<>c__DisplayClass0_0.<Main>b__0() in D:\a\1\s\src\OmniSharp.Stdio.Driver\Program.cs:line 84
   at OmniSharp.HostHelpers.Start(Func`1 action) in D:\a\1\s\src\OmniSharp.Host\HostHelpers.cs:line 30

Steps to reproduce

Create a new project with a folder that contains spaces

Expected behavior

Analyze all files and provide intellisense autocomplete

Actual behavior

Omnisharp does not load, and does not work.

@jtsom
Copy link

jtsom commented Apr 4, 2022

Is this a new/changed behavior? I've been able to open projects with spaces in the path just fine.

@JoeRobich
Copy link
Member

Is this a new/changed behavior? I've been able to open projects with spaces in the path just fine.

Seems to affect launching O# when omnisharp.useModernNet is set to true.

@JoeRobich
Copy link
Member

A prerelease build is out with a fix for this issue. https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.24.4-beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants