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

"Command line too long" error in C# 1.20.0 because of "files.exclude" setting #3127

Closed
stefanhamburger opened this issue Jun 19, 2019 · 3 comments

Comments

@stefanhamburger
Copy link

With the new feature to ignore all files in the files.exclude setting (#2171), projects will no longer load if too many files are exluded.

In my case, the files.exclude setting is around 6,400 characters long (depending on how it is serialized), which results in an error because the OmniSharp command line is too long.

According to this Windows support article, the maximum length is 8,191 characters and the only workaround is to pass the data via a local file instead.

As a workaround, users can downgrade to version 1.19.1 or shorten the number of files in their files.exclude setting.

Environment data

  • OS Name: Windows
  • OS Version: 10.0.18362
  • OS Platform: Windows
  • RID: win10-x64
  • VS Code version: 1.35.1
  • C# Extension version: 1.20.0

Steps to reproduce

  • Open a C# workspace in VS Code with a very long list of files and folders in the files.exclude setting.

Expected behavior

  • The project should load as expected.

Actual behavior

  • The following error message appears:
Starting OmniSharp server at 2019-6-19 09:33:43
    Target: d:\…\….sln

OmniSharp server started.
    Path: C:\Users\…\.vscode\extensions\ms-vscode.csharp-1.20.0\.omnisharp\1.32.20\OmniSharp.exe
    PID: 5076

Command line too long.
@rchande
Copy link

rchande commented Jun 19, 2019

@stefanhamburger That's an amazing find. You can work around this by putting your exclude files in omnisharp.json (https://github.com/OmniSharp/omnisharp-roslyn/wiki/Configuration-Options) instead of in your VS Code settings. Obviously that won't help if you need those exclusions in VS Code too.

@kthy
Copy link

kthy commented Jan 16, 2020

Yeah, no, that's not a workaround. I put the files in settings.json for a reason (namely that microsoft/vscode#38878 still isn't fixed).

@JoeRobich
Copy link
Member

Closing as it appears the referenced VS Code PR has merged so that .gitignore can be used to hide files in the VS Code file explorer.

@JoeRobich JoeRobich closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants