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 doesn't work at all in Emacs 28.1 #527

Open
EmilyGraceSeville7cf opened this issue Aug 6, 2022 · 10 comments
Open

Omnisharp doesn't work at all in Emacs 28.1 #527

EmilyGraceSeville7cf opened this issue Aug 6, 2022 · 10 comments

Comments

@EmilyGraceSeville7cf
Copy link

EmilyGraceSeville7cf commented Aug 6, 2022

I don't know why it doesn't work as expected. I've done the following steps:

  1. add omnisharp to my packages variable in ~/.emacs
  2. M-x load-file RET ~/.emacs
  3. dotnet new console --name Test
  4. dotnet new sln --name Test
  5. dotnet sln add ./Test/Test.csproj
  6. git init
  7. emacs -nw ./Test/Program.cs
  8. M-x omnisharp-install-server
  9. M-x omnisharp-start-omnisharp-server
  10. M-x company-mode RET

Note that I've tried to build project via dotnet build after no completion appeared and restarted Emacs with 7-10 steps repeated with no result...

No completion is shown for Console.. I wanna manually start omnisharp server to check whether it works and after it hook it start to opening C# files.

My ~/.emacs is:

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)

(setq packages '(soft-stone-theme flycheck markdown-mode json-mode yaml-mode format-all lsp-mode csharp-mode omnisharp lsp-pyright company))

(dolist (package packages)
  (package-install package))

(add-hook 'after-init-hook (lambda () (load-theme 'soft-stone t)))
(add-hook 'after-init-hook #'global-flycheck-mode)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(display-line-numbers 'relative)
 '(package-selected-packages
   '(omnisharp csharp-mode company lsp-pyright lsp-mode format-all yaml-mode json-mode markdown-mode flycheck soft-stone-theme)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

The last failed attempt to fix this problem was adding:

(setq omnisharp-expected-server-version "1.32.0") ; https://github.com/OmniSharp/omnisharp-vscode/issues/1450#issuecomment-432516876
(let ((dotnet-version (string-trim (shell-command-to-string "dotnet --version"))))
  ;; https://github.com/OmniSharp/omnisharp-emacs/issues/459#issuecomment-452656947
  (setenv "MSBuildSDKsPath" (format "/usr/share/dotnet/sdk/%s/Sdks" dotnet-version)))

right before custom-set-variables. I restarted Emacs, M-x omnisharp-start-omnisharp-server asked me to install omnisharp server (again?). I installed it, started via M-x omnisharp-start-omnisharp-server but no completion appeared.

Sometimes I obtain Package cl is deprepated error. It seems it happens only at first server start.

@EmilyGraceSeville7cf
Copy link
Author

EmilyGraceSeville7cf commented Aug 6, 2022

⚠️ omnisharp is installed manually via M-x package-install.

When I change my ~/.emacs config to this one:

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)

(setq packages '(soft-stone-theme flycheck markdown-mode json-mode yaml-mode format-all lsp-mode lsp-pyright company))

(dolist (package packages)
  (package-install package))

(add-hook 'after-init-hook (lambda () (load-theme 'soft-stone t)))
(add-hook 'after-init-hook #'global-flycheck-mode)

(eval-after-load
 'company
 '(add-to-list 'company-backends 'company-omnisharp))

(add-hook 'csharp-mode-hook #'company-mode)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(display-line-numbers 'relative)
 '(package-selected-packages
   '(omnisharp csharp-mode company lsp-pyright lsp-mode format-all yaml-mode json-mode markdown-mode flycheck soft-stone-theme)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

and open any ./Test/Program.cs from post above, start omnisharp server it fails with:

[01:52:04] starting server on project root "/home/emilyseville7cfg/Documents/Mine/CSharp/"
[01:52:04] Using server binary on /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/run
[01:52:05] INFORMATION: OmniSharp.Stdio.Host, Starting OmniSharp on ubuntu 22.4 (x64)
[01:52:05] INFORMATION: OmniSharp.Services.DotNetCliService, DotNetPath set to dotnet
[01:52:05] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Located 1 MSBuild instance(s)
            1: StandAlone 17.0.0 - "/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin"
[01:52:05] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, MSBUILD_EXE_PATH environment variable set to '/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[01:52:05] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Registered MSBuild instance: StandAlone 17.0.0 - "/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin"
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin
            CscToolPath = /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin/Roslyn
            BypassFrameworkInstallChecks = true
            MSBuildExtensionsPath = /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "Could not load signature of Roslynator.CSharp.SyntaxWalkers.CSharpSyntaxNodeWalker:VisitFileScopedNamespaceDeclaration due to: Could not resolve type with token 01000129 from typeref (expected class 'Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax' in assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax member:(null)"))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "System.TypeLoadException: Parent class vtable failed to initialize, due to: VTable setup of type Roslynator.CSharp.SyntaxWalkers.CSharpSyntaxNodeWalker failed assembly:/home/emilyseville7cfg/.vscode/extensions/josefpihrt-vscode.roslynator-4.1.1/roslyn/common/Roslynator.CSharp.dll type:CSharpSyntaxNodeWalker member:(null)"))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at (wrapper managed-to-native) System.RuntimeType.GetPropertiesByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,System.RuntimeType/MemberListType)"))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.RuntimeType.GetPropertiesByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.RuntimeType+MemberListType listType, System.RuntimeType reflectedType) [0x0001b] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.RuntimeType.GetPropertyCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Type[] types, System.Boolean allowPrefixLookup) [0x00010] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.RuntimeType.GetProperties (System.Reflection.BindingFlags bindingAttr) [0x00000] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties (System.Type type) [0x00014] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverPropertyExports>d__7.MoveNext () [0x00030] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverExports>d__5.MoveNext () [0x000dc] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.Discovery.TypeInspector.InspectTypeForPart (System.Reflection.TypeInfo type, System.Composition.TypedParts.Discovery.DiscoveredPart& part) [0x00061] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor (System.Collections.Generic.IEnumerable`1[T] types, System.Composition.Convention.AttributedModelProvider attributeContext) [0x00037] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.ContainerConfiguration.CreateContainer () [0x00042] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x00031] in <2b89d626687148ba8fbf92b75d65cebf>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.HostServicesAggregator.CreateHostServices () [0x00000] in <3c22014bb8b9403ba6b94645d03f0cd7>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.OmniSharpWorkspace..ctor (OmniSharp.HostServicesAggregator aggregator, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, OmniSharp.FileWatching.IFileSystemWatcher fileSystemWatcher) [0x00046] in <3c22014bb8b9403ba6b94645d03f0cd7>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at (wrapper dynamic-method) System.Object.lambda_method(System.Runtime.CompilerServices.Closure,System.Composition.Hosting.Core.LifetimeContext,System.Composition.Hosting.Core.CompositionOperation)"))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.ActivationFeatures.DisposalFeature+<>c__DisplayClass0_0.<RewriteActivator>b__0 (System.Composition.Hosting.Core.LifetimeContext c, System.Composition.Hosting.Core.CompositionOperation o) [0x00000] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate (System.Int32 sharingId, System.Composition.Hosting.Core.CompositionOperation operation, System.Composition.Hosting.Core.CompositeActivator creator) [0x000a8] in <8e026c716fc84f38aae28085eaaee9fc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.ActivationFeatures.LifetimeFeature+<>c__DisplayClass1_0.<RewriteActivator>b__0 (System.Composition.Hosting.Core.LifetimeContext c, System.Composition.Hosting.Core.CompositionOperation o) [0x00011] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.Core.CompositionOperation.Run (System.Composition.Hosting.Core.LifetimeContext outermostLifetimeContext, System.Composition.Hosting.Core.CompositeActivator compositionRootActivator) [0x0001c] in <8e026c716fc84f38aae28085eaaee9fc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.Core.LifetimeContext.TryGetExport (System.Composition.Hosting.Core.CompositionContract contract, System.Object& export) [0x0001d] in <8e026c716fc84f38aae28085eaaee9fc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.CompositionHost.TryGetExport (System.Composition.Hosting.Core.CompositionContract contract, System.Object& export) [0x00000] in <8e026c716fc84f38aae28085eaaee9fc>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.CompositionContext.GetExport (System.Composition.Hosting.Core.CompositionContract contract) [0x00000] in <12675e53c8854b48abd187539ce374db>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.CompositionContext.GetExport (System.Type exportType, System.String contractName) [0x00008] in <12675e53c8854b48abd187539ce374db>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.CompositionContext.GetExport[TExport] (System.String contractName) [0x00000] in <12675e53c8854b48abd187539ce374db>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.CompositionContext.GetExport[TExport] () [0x00000] in <12675e53c8854b48abd187539ce374db>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.Stdio.Host.Initialize () [0x0000d] in <65e0aca433ab4fb4946c0b3fc58fd85a>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.Stdio.Host..ctor (System.IO.TextReader input, OmniSharp.Services.ISharedTextWriter writer, OmniSharp.IOmniSharpEnvironment environment, System.IServiceProvider serviceProvider, OmniSharp.CompositionHostBuilder compositionHostBuilder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, System.Threading.CancellationTokenSource cancellationTokenSource) [0x0007b] in <65e0aca433ab4fb4946c0b3fc58fd85a>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_1.<Main>b__1 () [0x0017d] in <eda49c0af257459b858c33bd65a6834a>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.<OnExecute>b__0 () [0x0000b] in <02ecf52e50b5487fbf035af7482feffd>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x00039] in <344a1e8cd6594b17b1e01f8df6ae8827>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.CommandLineApplication.Execute (System.String[] args) [0x00081] in <02ecf52e50b5487fbf035af7482feffd>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00028] in <eda49c0af257459b858c33bd65a6834a>:0 "))
[01:52:06] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <02ecf52e50b5487fbf035af7482feffd>:0 "))

It doesn't work even when I move:

(eval-after-load
 'company
 '(add-to-list 'company-backends 'company-omnisharp))

(add-hook 'csharp-mode-hook #'company-mode)

to ~/.emacs.d/init.el file. Log for the second case is:

[02:05:40] starting server on project root "/home/emilyseville7cfg/Documents/Mine/CSharp/"
[02:05:40] Using server binary on /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/run
[02:05:41] INFORMATION: OmniSharp.Stdio.Host, Starting OmniSharp on ubuntu 22.4 (x64)
[02:05:41] INFORMATION: OmniSharp.Services.DotNetCliService, DotNetPath set to dotnet
[02:05:41] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Located 1 MSBuild instance(s)
            1: StandAlone 17.0.0 - "/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin"
[02:05:41] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, MSBUILD_EXE_PATH environment variable set to '/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[02:05:41] INFORMATION: OmniSharp.MSBuild.Discovery.MSBuildLocator, Registered MSBuild instance: StandAlone 17.0.0 - "/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin"
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin
            CscToolPath = /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin/Roslyn
            BypassFrameworkInstallChecks = true
            MSBuildExtensionsPath = /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "Could not load signature of Roslynator.CSharp.SyntaxWalkers.CSharpSyntaxNodeWalker:VisitFileScopedNamespaceDeclaration due to: Could not resolve type with token 01000129 from typeref (expected class 'Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax' in assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax member:(null)"))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "System.TypeLoadException: Parent class vtable failed to initialize, due to: VTable setup of type Roslynator.CSharp.SyntaxWalkers.CSharpSyntaxNodeWalker failed assembly:/home/emilyseville7cfg/.vscode/extensions/josefpihrt-vscode.roslynator-4.1.1/roslyn/common/Roslynator.CSharp.dll type:CSharpSyntaxNodeWalker member:(null)"))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at (wrapper managed-to-native) System.RuntimeType.GetPropertiesByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,System.RuntimeType/MemberListType)"))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.RuntimeType.GetPropertiesByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.RuntimeType+MemberListType listType, System.RuntimeType reflectedType) [0x0001b] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.RuntimeType.GetPropertyCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Type[] types, System.Boolean allowPrefixLookup) [0x00010] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.RuntimeType.GetProperties (System.Reflection.BindingFlags bindingAttr) [0x00000] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties (System.Type type) [0x00014] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverPropertyExports>d__7.MoveNext () [0x00030] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverExports>d__5.MoveNext () [0x000dc] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.Discovery.TypeInspector.InspectTypeForPart (System.Reflection.TypeInfo type, System.Composition.TypedParts.Discovery.DiscoveredPart& part) [0x00061] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor (System.Collections.Generic.IEnumerable`1[T] types, System.Composition.Convention.AttributedModelProvider attributeContext) [0x00037] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.ContainerConfiguration.CreateContainer () [0x00042] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x00031] in <2b89d626687148ba8fbf92b75d65cebf>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.HostServicesAggregator.CreateHostServices () [0x00000] in <3c22014bb8b9403ba6b94645d03f0cd7>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.OmniSharpWorkspace..ctor (OmniSharp.HostServicesAggregator aggregator, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, OmniSharp.FileWatching.IFileSystemWatcher fileSystemWatcher) [0x00046] in <3c22014bb8b9403ba6b94645d03f0cd7>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at (wrapper dynamic-method) System.Object.lambda_method(System.Runtime.CompilerServices.Closure,System.Composition.Hosting.Core.LifetimeContext,System.Composition.Hosting.Core.CompositionOperation)"))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.ActivationFeatures.DisposalFeature+<>c__DisplayClass0_0.<RewriteActivator>b__0 (System.Composition.Hosting.Core.LifetimeContext c, System.Composition.Hosting.Core.CompositionOperation o) [0x00000] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate (System.Int32 sharingId, System.Composition.Hosting.Core.CompositionOperation operation, System.Composition.Hosting.Core.CompositeActivator creator) [0x000a8] in <8e026c716fc84f38aae28085eaaee9fc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.TypedParts.ActivationFeatures.LifetimeFeature+<>c__DisplayClass1_0.<RewriteActivator>b__0 (System.Composition.Hosting.Core.LifetimeContext c, System.Composition.Hosting.Core.CompositionOperation o) [0x00011] in <9aac21a4a3f24063b2b8b59143acddfc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.Core.CompositionOperation.Run (System.Composition.Hosting.Core.LifetimeContext outermostLifetimeContext, System.Composition.Hosting.Core.CompositeActivator compositionRootActivator) [0x0001c] in <8e026c716fc84f38aae28085eaaee9fc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.Core.LifetimeContext.TryGetExport (System.Composition.Hosting.Core.CompositionContract contract, System.Object& export) [0x0001d] in <8e026c716fc84f38aae28085eaaee9fc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.Hosting.CompositionHost.TryGetExport (System.Composition.Hosting.Core.CompositionContract contract, System.Object& export) [0x00000] in <8e026c716fc84f38aae28085eaaee9fc>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.CompositionContext.GetExport (System.Composition.Hosting.Core.CompositionContract contract) [0x00000] in <12675e53c8854b48abd187539ce374db>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.CompositionContext.GetExport (System.Type exportType, System.String contractName) [0x00008] in <12675e53c8854b48abd187539ce374db>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.CompositionContext.GetExport[TExport] (System.String contractName) [0x00000] in <12675e53c8854b48abd187539ce374db>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at System.Composition.CompositionContext.GetExport[TExport] () [0x00000] in <12675e53c8854b48abd187539ce374db>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.Stdio.Host.Initialize () [0x0000d] in <65e0aca433ab4fb4946c0b3fc58fd85a>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.Stdio.Host..ctor (System.IO.TextReader input, OmniSharp.Services.ISharedTextWriter writer, OmniSharp.IOmniSharpEnvironment environment, System.IServiceProvider serviceProvider, OmniSharp.CompositionHostBuilder compositionHostBuilder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, System.Threading.CancellationTokenSource cancellationTokenSource) [0x0007b] in <65e0aca433ab4fb4946c0b3fc58fd85a>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_1.<Main>b__1 () [0x0017d] in <eda49c0af257459b858c33bd65a6834a>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.<OnExecute>b__0 () [0x0000b] in <02ecf52e50b5487fbf035af7482feffd>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x00039] in <344a1e8cd6594b17b1e01f8df6ae8827>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.CommandLineApplication.Execute (System.String[] args) [0x00081] in <02ecf52e50b5487fbf035af7482feffd>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00028] in <eda49c0af257459b858c33bd65a6834a>:0 "))
[02:05:41] <-- Received an unknown server packet: ((ServerMessageParseError . "The server sent an unknown json message. Inspect the omnisharp-server process buffer to view recent messages from the server. Set `omnisharp-debug' to t and inspect the *omnisharp-debug* buffer for this error specifically.") (Message . "  at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <02ecf52e50b5487fbf035af7482feffd>:0 "))

@mateialexandru
Copy link

Same issue, on Windows 11, Emacs 28.1

@razzmatazz
Copy link
Contributor

this is most probably random gibberish from omnisharp via stdin that is being interpreted as json.. maybe an error message..

could you run /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/run directly from the terminal? you should see the actual error messages/blurb it is emitting to the stdio

IIRC the arguments to start omnisharp-roslyn in stdio mode is:

  • ./run --stdio

@EmilyGraceSeville7cf
Copy link
Author

/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/run produces this output:

{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Stdio.Host","Message":"Starting OmniSharp on ubuntu 22.4 (x64)"},"Seq":1,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Services.DotNetCliService","Message":"DotNetPath set to dotnet"},"Seq":2,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Located 1 MSBuild instance(s)\n            1: StandAlone 17.0.0 - \"/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin\""},"Seq":3,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"MSBUILD_EXE_PATH environment variable set to '/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin/MSBuild.exe'"},"Seq":4,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.Discovery.MSBuildLocator","Message":"Registered MSBuild instance: StandAlone 17.0.0 - \"/home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin\"\n            CscToolExe = csc.exe\n            MSBuildToolsPath = /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin\n            CscToolPath = /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild/Current/Bin/Roslyn\n            BypassFrameworkInstallChecks = true\n            MSBuildExtensionsPath = /home/emilyseville7cfg/.emacs.d/.cache/omnisharp/server/v1.37.13/omnisharp/.msbuild"},"Seq":5,"Type":"event"}
Could not load signature of Roslynator.CSharp.SyntaxWalkers.CSharpSyntaxNodeWalker:VisitFileScopedNamespaceDeclaration due to: Could not resolve type with token 01000129 from typeref (expected class 'Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax' in assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax member:(null)
System.TypeLoadException: Parent class vtable failed to initialize, due to: VTable setup of type Roslynator.CSharp.SyntaxWalkers.CSharpSyntaxNodeWalker failed assembly:/home/emilyseville7cfg/.vscode/extensions/josefpihrt-vscode.roslynator-4.1.1/roslyn/common/Roslynator.CSharp.dll type:CSharpSyntaxNodeWalker member:(null)
  at (wrapper managed-to-native) System.RuntimeType.GetPropertiesByName_native(System.RuntimeType,intptr,System.Reflection.BindingFlags,System.RuntimeType/MemberListType)
  at System.RuntimeType.GetPropertiesByName (System.String name, System.Reflection.BindingFlags bindingAttr, System.RuntimeType+MemberListType listType, System.RuntimeType reflectedType) [0x0001b] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 
  at System.RuntimeType.GetPropertyCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Type[] types, System.Boolean allowPrefixLookup) [0x00010] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 
  at System.RuntimeType.GetProperties (System.Reflection.BindingFlags bindingAttr) [0x00000] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 
  at System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties (System.Type type) [0x00014] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverPropertyExports>d__7.MoveNext () [0x00030] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector+<DiscoverExports>d__5.MoveNext () [0x000dc] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.Discovery.TypeInspector.InspectTypeForPart (System.Reflection.TypeInfo type, System.Composition.TypedParts.Discovery.DiscoveredPart& part) [0x00061] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor (System.Collections.Generic.IEnumerable`1[T] types, System.Composition.Convention.AttributedModelProvider attributeContext) [0x00037] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.Hosting.ContainerConfiguration.CreateContainer () [0x00042] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create (System.Collections.Generic.IEnumerable`1[T] assemblies) [0x00031] in <2b89d626687148ba8fbf92b75d65cebf>:0 
  at OmniSharp.HostServicesAggregator.CreateHostServices () [0x00000] in <3c22014bb8b9403ba6b94645d03f0cd7>:0 
  at OmniSharp.OmniSharpWorkspace..ctor (OmniSharp.HostServicesAggregator aggregator, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, OmniSharp.FileWatching.IFileSystemWatcher fileSystemWatcher) [0x00046] in <3c22014bb8b9403ba6b94645d03f0cd7>:0 
  at (wrapper dynamic-method) System.Object.lambda_method(System.Runtime.CompilerServices.Closure,System.Composition.Hosting.Core.LifetimeContext,System.Composition.Hosting.Core.CompositionOperation)
  at System.Composition.TypedParts.ActivationFeatures.DisposalFeature+<>c__DisplayClass0_0.<RewriteActivator>b__0 (System.Composition.Hosting.Core.LifetimeContext c, System.Composition.Hosting.Core.CompositionOperation o) [0x00000] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.Hosting.Core.LifetimeContext.GetOrCreate (System.Int32 sharingId, System.Composition.Hosting.Core.CompositionOperation operation, System.Composition.Hosting.Core.CompositeActivator creator) [0x000a8] in <8e026c716fc84f38aae28085eaaee9fc>:0 
  at System.Composition.TypedParts.ActivationFeatures.LifetimeFeature+<>c__DisplayClass1_0.<RewriteActivator>b__0 (System.Composition.Hosting.Core.LifetimeContext c, System.Composition.Hosting.Core.CompositionOperation o) [0x00011] in <9aac21a4a3f24063b2b8b59143acddfc>:0 
  at System.Composition.Hosting.Core.CompositionOperation.Run (System.Composition.Hosting.Core.LifetimeContext outermostLifetimeContext, System.Composition.Hosting.Core.CompositeActivator compositionRootActivator) [0x0001c] in <8e026c716fc84f38aae28085eaaee9fc>:0 
  at System.Composition.Hosting.Core.LifetimeContext.TryGetExport (System.Composition.Hosting.Core.CompositionContract contract, System.Object& export) [0x0001d] in <8e026c716fc84f38aae28085eaaee9fc>:0 
  at System.Composition.Hosting.CompositionHost.TryGetExport (System.Composition.Hosting.Core.CompositionContract contract, System.Object& export) [0x00000] in <8e026c716fc84f38aae28085eaaee9fc>:0 
  at System.Composition.CompositionContext.GetExport (System.Composition.Hosting.Core.CompositionContract contract) [0x00000] in <12675e53c8854b48abd187539ce374db>:0 
  at System.Composition.CompositionContext.GetExport (System.Type exportType, System.String contractName) [0x00008] in <12675e53c8854b48abd187539ce374db>:0 
  at System.Composition.CompositionContext.GetExport[TExport] (System.String contractName) [0x00000] in <12675e53c8854b48abd187539ce374db>:0 
  at System.Composition.CompositionContext.GetExport[TExport] () [0x00000] in <12675e53c8854b48abd187539ce374db>:0 
  at OmniSharp.Stdio.Host.Initialize () [0x0000d] in <65e0aca433ab4fb4946c0b3fc58fd85a>:0 
  at OmniSharp.Stdio.Host..ctor (System.IO.TextReader input, OmniSharp.Services.ISharedTextWriter writer, OmniSharp.IOmniSharpEnvironment environment, System.IServiceProvider serviceProvider, OmniSharp.CompositionHostBuilder compositionHostBuilder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, System.Threading.CancellationTokenSource cancellationTokenSource) [0x0007b] in <65e0aca433ab4fb4946c0b3fc58fd85a>:0 
  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_1.<Main>b__1 () [0x0017d] in <eda49c0af257459b858c33bd65a6834a>:0 
  at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.<OnExecute>b__0 () [0x0000b] in <02ecf52e50b5487fbf035af7482feffd>:0 
  at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x00039] in <344a1e8cd6594b17b1e01f8df6ae8827>:0 
  at OmniSharp.CommandLineApplication.Execute (System.String[] args) [0x00081] in <02ecf52e50b5487fbf035af7482feffd>:0 
  at OmniSharp.Stdio.Driver.Program+<>c__DisplayClass0_0.<Main>b__0 () [0x00028] in <eda49c0af257459b858c33bd65a6834a>:0 
  at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <02ecf52e50b5487fbf035af7482feffd>:0

@razzmatazz
Copy link
Contributor

razzmatazz commented Aug 26, 2022

Could not load signature of Roslynator.CSharp.SyntaxWalkers.CSharpSyntaxNodeWalker:VisitFileScopedNamespaceDeclaration due to: Could not resolve type with token 01000129 from typeref (expected class 'Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax' in assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35') assembly:Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 type:Microsoft.CodeAnalysis.CSharp.Syntax.FileScopedNamespaceDeclarationSyntax member:(null)
System.TypeLoadException: Parent class vtable failed to initialize, due to: VTable setup of type Roslynator.CSharp.SyntaxWalkers.CSharpSyntaxNodeWalker failed assembly:/home/emilyseville7cfg/.vscode/extensions/josefpihrt-vscode.roslynator-4.1.1/roslyn/common/Roslynator.CSharp.dll type:CSharpSyntaxNodeWalker member:(null)

oh, this looks very much like a mono/runtime issue (?) and should be reported to omnisharp-roslyn (underlying language server) repository:

@EmilyGraceSeville7cf
Copy link
Author

EmilyGraceSeville7cf commented Aug 26, 2022

I've created the issue in their repo. ;)

@razzmatazz
Copy link
Contributor

In the meantime, have you tried using emacs/lsp-mode (or joaotavora/eglot) for C# on emacs? Are there any issues?

Because eventually omnisharp-emacs will get deprecated..

@EmilyGraceSeville7cf
Copy link
Author

EmilyGraceSeville7cf commented Aug 26, 2022

No, I don't see any benefit for my self in eglot. I've used just package.el.

@razzmatazz
Copy link
Contributor

razzmatazz commented Aug 26, 2022

Oh, I am not sure I expressed myself properly, basically on emacs (AFAIK) there are 5 options to get C# integration in the editor:

  • (a) omnisharp-emacs + omnisharp-roslyn (legacy omnisharp-roslyn protocol) – which you are using now
  • (b) lsp-mode + omnisharp-roslyn (LSP mode)
  • (c) lsp-mode + csharp-ls (LSP mode)
  • (d) eglot + omnisharp-roslyn (LSP mode)
  • (e) eglot + csharp-ls (LSP mode)

option (a) is a bit outdated, as LSP mode is being actively developed, both the clients and servers

@VM-KTO
Copy link

VM-KTO commented Mar 10, 2023

I am trying to set this up for the first time in 28.2. is this realistic, I can't get anything but syntax color highlighting to work?

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

4 participants