OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.72k stars 168 forks source link

Installation Error #638

Closed TheYellowArchitect closed 4 years ago

TheYellowArchitect commented 4 years ago

Hello!

I am a newbie on this kind of stuff, but I will do my best to detail everything on the issue

I have Windows 7, and installed Vim 8, Vim works without issues I want to use this https://github.com/OmniSharp/omnisharp-vim I downloaded it, placed it onto

C:\Program Files (x86)\Vim\vim82\pack\vendor\start

Whenever I boot Vim and open a .cs file, it gives the "Needs Roslyn Server" so it seems to have worked. It asks to download&install Roslyn Server RoslynInstallation I press Yes RoslynError

No idea what that means, or how to edit that id variable. Anyway, since omnisharp-roslyn is a dependency of omnisharp-vim (which seems to work fine), I download it, place it on a folder, open the vimrc settings let g:OmniSharp_server_path = 'C:\Program Files (x86)\Vim\vim82\pack\vendor\start\omnisharp.win-x64\OmniSharp.exe' (Being on start doesn't matter, even when it was on C:\Program Files (x86)\OmniSharp\omnisharp.win-x64\OmniSharp.exe along with the files ofc, it had the same result) And I get this when I open a .cs file with it RoslynDetected

Since the release version has failed me, I go clone the omnisharp-roslyn, and try to build it. Downloaded the .NET dependency it asked for Windows. I ran build.sh, and... It downloaded NuGet packages but then the below picture happens when I click it again There is a folder of .omnisharp on home directory but it is empty (no hidden files) Build Failure

=====

I sadly do not know if this is a bug or I am missing something, I report this nonetheless since I am truly looking forward to using omnisharp-vim

nickspoons commented 4 years ago

Hi @Balroth, the primary issue here is that OmniSharp-vim is not installing the server correctly.

What is the exact version of your vim (:version)? Vim 8.0 is very old now, perhaps try getting the latest version here

However as filipw said in the other issue, Win7 is not supported by OmniSharp-roslyn so I'm not exactly sure what your experience will be like once you get it installed properly.

TheYellowArchitect commented 4 years ago

It is 8.2 Vim Versionm

Also while it is unsupported, I do want to try it regardless, since I'm fairly certain it is not a windows issue

nickspoons commented 4 years ago

Ok. Can you try reinstalling the server, with :OmniSharpInstall, and see if you get the same error? (It might be that the GitHub download failed, which happens periodically)

TheYellowArchitect commented 4 years ago

This is weird. :OmniSharpInstall command seems to work but doesn't install anything OmniSharpInstall

I also ran Vim as Administrator, to make sure it has access to that folder and to create that there (result is picture above)

To put misc information in case it helps: OmniSharp-Vim is placed here (and it asks for roslyn server when I bootup on any .cs file or bootup and then open a .cs file) OmniSharp Location

I also tried the following. I put the OmniSharpRoslynServer in the following path, manually. image It was empty of files as you can see in the first image Then I bootup Vim on a .cs file It asks to install Server, I press Yes I got this result RoslynRip And the folder became empty again O_o

The Vimrc file (which is located on C:/Balroth)

:set nu
:set guifont=Courier_New:h10
:syntax on
:set autoindent
:set smartindent
:set shiftwidth=4
:set tabstop=4

"Press i to enter insert mode, and ii to exit.
:imap ii <Esc>

"Because backspace doesn't work at all lmao, really awkward to exit insert mode and press X"
set backspace=indent,eol,start

"===OmniSharp==="
"Loading packages earlier"
"Doesn't really make a difference"
":packloadall"

"For OmniSharp"
filetype indent plugin on

"For finding the Roslyn Server so OmniSharp can work"
"let g:OmniSharp_server_path = 'C:\Program Files (x86)\Vim\vim82\pack\vendor\start\omnisharp.win-x64\OmniSharp.exe'"

" Tell ALE to use OmniSharp for linting C# files, and no other linters.
"let g:ale_linters = { 'cs': ['OmniSharp'] }"

"===Ale==="
" Put these lines at the very end of your vimrc file.

" Load all plugins now.
" Plugins need to be added to runtimepath before helptags can be generated.
packloadall
" Load all of the helptags now, after plugins have been loaded.
" All messages and errors will be ignored.
silent! helptags ALL
nickspoons commented 4 years ago

What does this mean:

I also tried the following. I put the OmniSharpRoslynServer in the following path, manually.

That sounds sensible, that's what I'd suggest you try, but what are you putting there? What you should put there is the extracted files from the latest OmniSharp-roslyn release, which you can find here ("omnisharp-win-x64.zip").

Note that when you run :OmniSharpInstall the C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn directory is deleted, and recreated.

TheYellowArchitect commented 4 years ago

but what are you putting there? What you should put there is the extracted files from the latest OmniSharp-roslyn release, which you can find here ("omnisharp-win-x64.zip")

That folder is what I am placing OmniSharpRoslynFile I did try deleting it after the failed installation then re-extracting, the result is the same :(

Note that when you run :OmniSharpInstall the C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn directory is deleted, and recreated. I didn't know this, thanks, solves the weird deletion

As for the plugins, while I am a newbie on them, I installed NerdTree which works perfectly and hence OmniSharp should work perfectly as well (it wasn't confirmed before as it simply asked for the server)

Is there anything else I should try before trying old roslyn versions or something? Anything!

nickspoons commented 4 years ago

Don't put a folder there. Put its contents there. OmniSharp-vim is looking for this file:

C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\OmniSharp.exe

TheYellowArchitect commented 4 years ago

... You are correct. At the same time I feel bad I didn't try this out... Putting the folder's contents and not the folder itself, on the path

C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn

Seems to have made some progress finally.

This is the result 14

I closed it after this and re-opened Vim with Admin Rights, and this is the result 15

I deleted the roslyn folder and replaced it with the files so as to confirm the installation wasn't corrupted Opening it without admin rights, after the installation is done, once again does the first image thing "Can't Create File stdio.log", very weird Anyway, it seems to work when opened with Admin Rights :+1: ((Could you drop a quick link to opening Vim automatically with Admin Rights? A quick google search isn't very useful))

Man thank you so much for the help, I honestly didn't expect to solve this and was already searching for other C# plugins (all using roslyn server -_-)

I will use it for a day or two, then close this issue if everything is smooth (I hope so xD)

nickspoons commented 4 years ago

The admin issue is occurring because OmniSharp-vim is trying to write logs to a subfolder of the plugin, which is in your Program Files, so it does not have permission.

I would suggest moving your plugins to C:\Users\Balroth\vimfiles\pack. Running vim as admin all the time is not a good idea.

TheYellowArchitect commented 4 years ago

You are right about admin rights, having Vim open with admin rights to make it work would be a slapstick solution, not a long-term one

I am new to plugins (and Vim), I moved the plugins there (there was no pack folder, but I made one) vim roslyn moving

Moved them all here, seems to have worked and they all launch on boot C:\Users\Balroth\vimfiles\pack\vendor\start

Once again, thank you very much, it all works, I will try to write some actual code and close this issue if everything is perfect because it is spooky obvious mistakes are not highlighted (same variable name) before after (If the issue is unrelated to installation which is likely, I will create a new one and close this)

Thanks!!! :+1:

nickspoons commented 4 years ago

Your server is launching, that's good. But it is not loading your project correctly. Have a look at the log to find out why: :OmniSharpOpenLog.

TheYellowArchitect commented 4 years ago

I have no idea how you noticed that the project is not loading correctly, but you are right (3 [fails] in the log)

Here is the log

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 12 2019 13:30:17), MS-Windows 32-bit GUI version with OLE support

OmniSharp server started.
    Path: C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\OmniSharp.exe
    Target: C:\Users\Balroth
    PID: 5124

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.1.7601.65536 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.8.0 - "C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to 'C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 16.8.0 - "C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin"
            CscToolExe = csc.exe
            CscToolPath = C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin\Roslyn
            MSBuildExtensionsPath = C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild
            MSBuildToolsPath = C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'C:\Users\Balroth'.
[fail]: OmniSharp.WorkspaceInitializer
        The project system 'OmniSharp.Cake.CakeProjectSystem' threw exception during initialization.
System.UnauthorizedAccessException: Access to the path 'C:\Users\Balroth\AppData\Local\Application Data' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption)
   at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__4.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute()
   at Microsoft.Extensions.FileSystemGlobbing.MatcherExtensions.GetResultsInFullPath(Matcher matcher, String directoryPath)
   at OmniSharp.Cake.CakeProjectSystem.Initalize(IConfiguration configuration) in D:\a\1\s\src\OmniSharp.Cake\CakeProjectSystem.cs:line 83
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost) in D:\a\1\s\src\OmniSharp.Host\WorkspaceInitializer.cs:line 43
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in 'C:\Users\Balroth'
[fail]: OmniSharp.WorkspaceInitializer
        The project system 'OmniSharp.MSBuild.ProjectSystem' threw exception during initialization.
System.UnauthorizedAccessException: Access to the path 'C:\Users\Balroth\AppData\Local\Application Data' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption)
   at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__4.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute()
   at Microsoft.Extensions.FileSystemGlobbing.MatcherExtensions.GetResultsInFullPath(Matcher matcher, String directoryPath)
   at OmniSharp.MSBuild.ProjectSystem.GetInitialProjectPathsAndIds() in D:\a\1\s\src\OmniSharp.MSBuild\ProjectSystem.cs:line 151
   at OmniSharp.MSBuild.ProjectSystem.Initalize(IConfiguration configuration) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectSystem.cs:line 117
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost) in D:\a\1\s\src\OmniSharp.Host\WorkspaceInitializer.cs:line 43
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'C:\Users\Balroth'.
[fail]: OmniSharp.WorkspaceInitializer
        The project system 'OmniSharp.Script.ScriptProjectSystem' threw exception during initialization.
System.UnauthorizedAccessException: Access to the path 'C:\Users\Balroth\AppData\Local\Application Data' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption)
   at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__4.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute()
   at Microsoft.Extensions.FileSystemGlobbing.MatcherExtensions.GetResultsInFullPath(Matcher matcher, String directoryPath)
   at OmniSharp.Script.ScriptProjectSystem.Initalize(IConfiguration configuration) in D:\a\1\s\src\OmniSharp.Script\ScriptProjectSystem.cs:line 64
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost) in D:\a\1\s\src\OmniSharp.Host\WorkspaceInitializer.cs:line 43
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'C:\Users\Balroth' on host -1.
Workspace complete: no projects
All projects loaded
[info]: OmniSharp.OmniSharpWorkspace
        Miscellaneous file: C:\Users\Balroth\Desktop\text.cs added to workspace
Replaying requests for buffer 1
Replaying on-load requests

Using Admin Rights seems to have the same result

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Dec 12 2019 13:30:17), MS-Windows 32-bit GUI version with OLE support

OmniSharp server started.
    Path: C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\OmniSharp.exe
    Target: C:\Users\Balroth
    PID: 3884

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.1.7601.65536 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 16.8.0 - "C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to 'C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 16.8.0 - "C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin"
            CscToolExe = csc.exe
            CscToolPath = C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin\Roslyn
            MSBuildExtensionsPath = C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild
            MSBuildToolsPath = C:\Users\Balroth\AppData\Local\omnisharp-vim\omnisharp-roslyn\.msbuild\Current\Bin
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'C:\Users\Balroth'.
[fail]: OmniSharp.WorkspaceInitializer
        The project system 'OmniSharp.Cake.CakeProjectSystem' threw exception during initialization.
System.UnauthorizedAccessException: Access to the path 'C:\Users\Balroth\AppData\Local\Application Data' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption)
   at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__4.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute()
   at Microsoft.Extensions.FileSystemGlobbing.MatcherExtensions.GetResultsInFullPath(Matcher matcher, String directoryPath)
   at OmniSharp.Cake.CakeProjectSystem.Initalize(IConfiguration configuration) in D:\a\1\s\src\OmniSharp.Cake\CakeProjectSystem.cs:line 83
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost) in D:\a\1\s\src\OmniSharp.Host\WorkspaceInitializer.cs:line 43
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in 'C:\Users\Balroth'
[fail]: OmniSharp.WorkspaceInitializer
        The project system 'OmniSharp.MSBuild.ProjectSystem' threw exception during initialization.
System.UnauthorizedAccessException: Access to the path 'C:\Users\Balroth\AppData\Local\Application Data' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption)
   at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__4.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute()
   at Microsoft.Extensions.FileSystemGlobbing.MatcherExtensions.GetResultsInFullPath(Matcher matcher, String directoryPath)
   at OmniSharp.MSBuild.ProjectSystem.GetInitialProjectPathsAndIds() in D:\a\1\s\src\OmniSharp.MSBuild\ProjectSystem.cs:line 151
   at OmniSharp.MSBuild.ProjectSystem.Initalize(IConfiguration configuration) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectSystem.cs:line 117
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost) in D:\a\1\s\src\OmniSharp.Host\WorkspaceInitializer.cs:line 43
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'C:\Users\Balroth'.
[fail]: OmniSharp.WorkspaceInitializer
        The project system 'OmniSharp.Script.ScriptProjectSystem' threw exception during initialization.
System.UnauthorizedAccessException: Access to the path 'C:\Users\Balroth\AppData\Local\Application Data' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.DirectoryInfo.EnumerateFileSystemInfos(String searchPattern, SearchOption searchOption)
   at Microsoft.Extensions.FileSystemGlobbing.Abstractions.DirectoryInfoWrapper.<EnumerateFileSystemInfos>d__4.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Match(DirectoryInfoBase directory, String parentRelativePath)
   at Microsoft.Extensions.FileSystemGlobbing.Internal.MatcherContext.Execute()
   at Microsoft.Extensions.FileSystemGlobbing.MatcherExtensions.GetResultsInFullPath(Matcher matcher, String directoryPath)
   at OmniSharp.Script.ScriptProjectSystem.Initalize(IConfiguration configuration) in D:\a\1\s\src\OmniSharp.Script\ScriptProjectSystem.cs:line 64
   at OmniSharp.WorkspaceInitializer.Initialize(IServiceProvider serviceProvider, CompositionHost compositionHost) in D:\a\1\s\src\OmniSharp.Host\WorkspaceInitializer.cs:line 43
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'C:\Users\Balroth' on host -1.
Workspace complete: no projects
All projects loaded
[info]: OmniSharp.OmniSharpWorkspace
        Miscellaneous file: C:\Users\Balroth\Desktop\text.cs added to workspace
Replaying requests for buffer 1
Replaying on-load requests
TheYellowArchitect commented 4 years ago

The exceptions seem to throw

System.UnauthorizedAccessException

This is like the issue you mentioned above with admin rights, correct?

The admin issue is occurring because OmniSharp-vim is trying to write logs to a subfolder of the plugin, which is in your Program Files, so it does not have permission.

If so, what location needs no admin rights to write, and can take vimplugins? (Asking since I have no idea what directories Vim checks on bootup to find the folder "Start")

nickspoons commented 4 years ago

No, this is something else. Before, OmniSharp-vim was trying to write to the plugin sub-directory under Program Files. Now OmniSharp-roslyn is trying to write to AppData under your home directory. I would have thought that should be legal.

We may be getting into the "unsupported" aspects of OmniSharp-roslyn here. I don't know what it is trying to write or what permissions it needs.

TheYellowArchitect commented 4 years ago

We may be getting into the "unsupported" aspects of OmniSharp-roslyn here. I don't know what it is trying to write or what permissions it needs.

Couldn't I somehow give it admin rights and be finished with it? Or allowing anything to write on AppData? I don't see it working 100% any other way at this point I know it is bad practice, but I really want to get it to work :(

nickspoons commented 4 years ago

I really don't know. I don't know what OmniSharp-roslyn is doing at that point, or if it even is OmniSharp-roslyn or something else like dotnet

nickspoons commented 4 years ago

You could try adding any write permissions you can think of to "C:\Users\Balroth\AppData\Local\Application Data" and see what happens? Otherwise you could try opening a new issue in OmniSharp-roslyn for this error you're hitting and see if anyone has any ideas.

TheYellowArchitect commented 4 years ago

You could try adding any write permissions you can think of to "C:\Users\Balroth\AppData\Local\Application Data" and see what happens?

I opened App Data's Properties, it seems to be the only folder with "Unknown" account, which I assume is roslyn's fail installation 14 I gave it full permissions (very risky)

I opened a .cs file, roslyn started scanning literally every .cs file in my pc, and got some errors via the :OmniSharpOpenLog command you mentioned, all of them about not having Microsoft .NET Framework 4.6.1

Downloaded and installed that framework.

Re-opened, still says not found... However, it seems like roslyn scans all files under Desktop, where all my Unity projects are

If I open any C# file at the deepest filepath, it opens perfectly, :OmniSharpOpenLog is clean, so that's something

I tried integrating Vim (with OmniSharp plugins) with Unity, aka opening a project and to have no problems (in the log, and also auto-complete and stuff) but there are many different ones. It is too much I think for just a Unity code editor, and at least we can close this issue since the installation is complete, no more errors on installing the server.

You helped me install the roslyn server and bypass many many issues, I thank you for that. What I learnt can be used for future projects, after all I still like Vim Thanks again for the swift replies, all of them extremely helpful :+1:

nickspoons commented 4 years ago

OmniSharp does not create or alter the AppData directory, that is part of your operating system.

OmniSharp-vim searches for a project to manage .cs files. It searches up each directory until it finds a .sln so if you have one in your home directory then that will be used. It doesn't make much sense to keep .slns in your home directory anyway, I would suggest moving them and keeping your projects in separate directories.

If no .sln is found, the nearest .csproj will be used as the root of the project. If no .csproj is found, it will do its best without any project, but C# does not really work without a project so this will have limited success.