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

Message: Internal Error - System.ArgumentException: OmniSharp only supports being launched with a directory path or a path to a solution (.sln) file. #213

Closed
GNSubrahmanyam opened this issue May 18, 2020 · 14 comments

Comments

@GNSubrahmanyam
Copy link

reference: https://github.com/OmniSharp/omnisharp-roslyn/issues/1798

@rcjsuen @akosyakov

@rcjsuen
Copy link
Contributor

rcjsuen commented May 18, 2020

@GNSubrahmanyam Is there a bug with monaco-languageclient? The error seems to indicate the path is wrong (or the C# code is parsing it incorrectly I guess).

@GNSubrahmanyam
Copy link
Author

GNSubrahmanyam commented May 18, 2020

I tried with

 "monaco-editor": "^0.19.3",
 "monaco-languageclient": "^0.12.0",

and
It's working

FROM node:8.16.0-stretch-slim

# Omnisharp
ENV OMNISHARP_VERSION 1.34.15
RUN curl -L -o omnisharp.tar.gz https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v$OMNISHARP_VERSION/omnisharp-linux-x64.tar.gz
RUN curl -L -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/43f3a3bd-3df2-41e6-beca-3ec4952ca6c4/30fe7779249607d1bb3bb4b20d61a479/dotnet-sdk-3.0.103-linux-x64.tar.gz
RUN mkdir -p /opt/dotnet && tar -zxf dotnet.tar.gz -C /opt/dotnet
RUN mkdir -p /opt/omnisharp && tar -zxf omnisharp.tar.gz -C /opt/omnisharp

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        libc6 \
        libgcc1 \
        libgssapi-krb5-2 \
        libicu57 \
        liblttng-ust0 \
        libssl1.0.2 \
        libstdc++6 \
        zlib1g \
        ca-certificates \
    && rm -rf /var/lib/apt/lists/*

RUN ln -s /opt/dotnet/dotnet /usr/bin/dotnet
ENV DOTNET_RUNNING_IN_CONTAINER=true \
  NUGET_XMLDOC_MODE=skip \
  DOTNET_USE_POLLING_FILE_WATCHER=true
# Trigger first run experience by running arbitrary cmd to populate local package cache
RUN dotnet help

but it is not working with

 "monaco-editor": "^0.20.0",
 "monaco-languageclient": "^0.13.0",
FROM ubuntu:18.04

# Omnisharp
ENV OMNISHARP_VERSION 1.34.15
RUN curl -L -o omnisharp.tar.gz https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v$OMNISHARP_VERSION/omnisharp-linux-x64.tar.gz
RUN curl -L -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/43f3a3bd-3df2-41e6-beca-3ec4952ca6c4/30fe7779249607d1bb3bb4b20d61a479/dotnet-sdk-3.0.103-linux-x64.tar.gz

@rcjsuen
Copy link
Contributor

rcjsuen commented May 18, 2020

@GNSubrahmanyam You can review the diff between 0.12.0 and 0.13.0 I guess.

What paths do you see being sent between 0.12.0 and 0.13.0?

@GNSubrahmanyam
Copy link
Author

@rcjsuen Is that a breaking changes all my language server pyls, csharp has stopped working

@rcjsuen
Copy link
Contributor

rcjsuen commented May 18, 2020

@rcjsuen Is that a breaking changes all my language server pyls, csharp has stopped working

@GNSubrahmanyam If it was a breaking change, I imagine there would be a lot more bugs open about this.

You appear to be using Monaco Editor 0.20.0 which is not currently supported. See #207.

@GNSubrahmanyam
Copy link
Author

Ok got it.

@GNSubrahmanyam
Copy link
Author

@rcjsuen still this is not fixed

message: "Failed to handle notification initialize - System.ArgumentException: OmniSharp only supports being launched with a directory path or a path to a solution (.sln) file.↵Parameter name: path↵  at OmniSharp.Services.OmniSharpEnvironment..ctor (System.String path, System.Int32 hostPid, Microsoft.Extensions.Logging.LogLevel logLevel, System.String[] additionalArguments) [0x00062] in <794013c6a6c5442b833dd5811946393a>:0 ↵  at OmniSharp.LanguageServerProtocol.LanguageServerHost.CreateCompositionHost (OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams initializeParams) [0x00048] in <e7040b2d91ef45e98d0151a0b375c494>:0 ↵  at OmniSharp.LanguageServerProtocol.LanguageServerHost.Initialize (OmniSharp.Extensions.LanguageServer.Server.ILanguageServer server, OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams initializeParams) [0x00000] in <e7040b2d91ef45e98d0151a0b375c494>:0 ↵  at OmniSharp.Extensions.LanguageServer.Server.LanguageServer+<>c__DisplayClass55_0.<MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle>b__0 (OmniSharp.Extensions.LanguageServer.Server.InitializeDelegate c) [0x00000] in <72d5c645fd274cab83fd1f12f360a92e>:0 ↵  at System.Linq.Enumerable+SelectListIterator`2[TSource,TResult].MoveNext () [0x00048] in <59093ef301a24e5a91cb0295fb832cca>:0 ↵  at System.Threading.Tasks.Task.WhenAll (System.Collections.Generic.IEnumerable`1[T] tasks) [0x000ba] in <a1ae6166591d4020b810288d19af38d4>:0 ↵  at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle (OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeParams request, System.Threading.CancellationToken token) [0x001f4] in <72d5c645fd274cab83fd1f12f360a92e>:0 ↵  at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, MediatR.RequestHandlerDelegate`1[TResponse] next) [0x000e1] in <72d5c645fd274cab83fd1f12f360a92e>:0 ↵  at MediatR.Pipeline.RequestPostProcessorBehavior`2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, MediatR.RequestHandlerDelegate`1[TResponse] next) [0x0007e] in <eabe42abe9454fa58bdac29bc6aabb6a>:0 ↵  at MediatR.Pipeline.RequestPreProcessorBehavior`2[TRequest,TResponse].Handle (TRequest request, System.Threading.CancellationToken cancellationToken, MediatR.RequestHandlerDelegate`1[TResponse] next) [0x0013e] in <eabe42abe9454fa58bdac29bc6aabb6a>:0 ↵  at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1[TDescriptor].RouteRequest (TDescriptor descriptor, OmniSharp.Extensions.JsonRpc.Server.Request request, System.Threading.CancellationToken token) [0x00399] in <da46d4e8076c414ebe949c0004330da2>:0 "

@GNSubrahmanyam
Copy link
Author

Usage:

const lspProcess = {
processName: 'csharp',
command: '/opt/omnisharp/run',
args: ['-s', ${path.resolve(/workspace/${userName}-${uniqueSlug}/)},'-lsp', '-debug']
}

https://github.com/TypeFox/monaco-languageclient/blob/master/example/src/json-server-launcher.ts#L19

const serverConnection = server.createServerProcess(lspProcess.processName, lspProcess.command, lspProcess.args)

@rcjsuen
Copy link
Contributor

rcjsuen commented May 30, 2020

@rcjsuen still this is not fixed

@GNSubrahmanyam You should check the path that you are sending to the language server I guess.

@GNSubrahmanyam
Copy link
Author

Before starting lsp I create directory dynamically inside /workspace

@rcjsuen Can you help me to fix it?

@rcjsuen
Copy link
Contributor

rcjsuen commented May 31, 2020

@rcjsuen Can you help me to fix it?

@GNSubrahmanyam Don't think anyone can really help you fix it unless they can clone your code or you have a completely self-contained example that reproduces the problem.

@GNSubrahmanyam
Copy link
Author

Sure will provide example

@GNSubrahmanyam
Copy link
Author

I fixed this issue. Workspace path was wrong. Thanks

@rcjsuen
Copy link
Contributor

rcjsuen commented May 31, 2020

I fixed this issue. Workspace path was wrong. Thanks

@GNSubrahmanyam Your path looked okay in #213 (comment) though. What was wrong?

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

No branches or pull requests

2 participants