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 Server fails to load project files #811

Closed
tonymishler opened this issue Oct 5, 2022 · 8 comments
Closed

Omnisharp Server fails to load project files #811

tonymishler opened this issue Oct 5, 2022 · 8 comments

Comments

@tonymishler
Copy link

When the server is attempting to load projects they all fail on the same missing method

[fail]: OmniSharp.MSBuild.ProjectManager 27 Failed to load project file 'C:\Users\tonym\source\repos\ButlerTransportation\ImageRetrievalWeb\ImageRetrievalWeb.csproj'. 26 System.MissingMethodException: Method not found: 'System.ReadOnlySpan1 Microsoft.IO.Path.GetFileName(System.ReadOnlySpan1<Char>)'. 25 at Microsoft.Build.Shared.FileMatcher.IsFileNameMatch(String path, String pattern)

I'm running on windows 11 using nvim.
I installed the the server using Mason

and the OmniSharp using Packer with the following configuration
use { "OmniSharp/omnisharp-vim", config = function() vim.g.OmniSharp_server_path = "C:\\Users\\tonym\\AppData\\Local\\omnisharp-vim\\omnisharp-roslyn\\OmniSharp.exe" vim.g.OmniSharp_server_stdio_quickload = 1 vim.g.OmniSharp_server_use_net6 = 1 end, }

@nickspoons
Copy link
Member

I installed the the server using Mason

I don't know what this means. Can't you just let OmniSharp-vim install the server?

@tonymishler
Copy link
Author

When I did that the server would never even attempt to start. I'll try it again and see what the logs say

@nickspoons
Copy link
Member

It looks like the same issue as #803 which should be resolved, a server error which has been fixed.

@tonymishler
Copy link
Author

using net6 combined with the server that comes from a OmniSharp-vim install fixed it. Thanks!

@nickspoons
Copy link
Member

Cool, glad to hear!

@rcmosher
Copy link

rcmosher commented Oct 13, 2022

Edit: working around the install issue by running the powershell script directly in powershell has resolved it for me on Windows. And installing from Windows seems to have resolved it for WSL as well. Not sure how it knew which directory to use as WSL installed to omnisharp-rosly and windows to omnisharp-roslyn.

@tonymishler What exact steps did you take to resolve this? I'm having the same issue in WSL but am unable to resolve even with the latest beta of OmniSharp. I tried installing in Windows to make sure WSL wasn't the problem but have the same issue. Though I didn't do a standard OmniSharpInstall as that errors out on me currently.

@tonymishler
Copy link
Author

I uninstalled the Mason install of the server and did a fresh install with packer of OmniSharp and it worked. Be aware that it will tell you a server isn't started if it can't detect a .sln file in your vim context. Make sure to start nvim in the directory that contains the .sln file.

@nickspoons
Copy link
Member

You don't need to start vim in a directory containing a .sln. We find the .sln by searching up the directory tree from a .cs file. You can have multiple solutions open simultaneously in a single vim session, but no server will be started until you open a .cs file.

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

3 participants