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

Intellisense does not work with multiple directories in the workspace. #4214

Closed
AquariusStar opened this issue Nov 18, 2020 · 5 comments
Closed

Comments

@AquariusStar
Copy link

There is a shared directory with three directories and one work.code-workspace file. Dotnet projects are created in each folder. Two of them are libraries. And one main one that connects to two library projects. And I noticed that Intellisense only works in one of them. And only the last one in the list works. If you don't use work.code-workspace, Intellisense works in all three directories. And this is inconvenient. Because work.code-workspace is used to perform some parameters.
"folders": [ { "path": "Service.TCP" // intellisense not working (main) }, { "path": "Service.IO.UART" // intellisense not working }, { "path": "Service.Device.Control" // intellisense working } ],

@stewartadam
Copy link

What does your omnisharp log show? (Output tab, select Omnisharp Log from the drop-down). I've seen similar behavior when one of the projects has trouble loading, and omnisharp appears to get 'stuck'.

@AquariusStar
Copy link
Author

Judging by the log, he sees only one folder with the project for some reason. Below I post the omnisharp log:
Starting OmniSharp server at 03.12.2020, 10:51:07
Target: f:\Repository\Raspberry\TestProject\Service.Device.Control

OmniSharp server started.
Path: c:\Users\Michael.vscode\extensions\ms-dotnettools.csharp-1.23.6.omnisharp\1.37.3\OmniSharp.exe
PID: 7684

Starting OmniSharp on Windows 6.2.9200.0 (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\Michael.vscode\extensions\ms-dotnettools.csharp-1.23.6.omnisharp\1.37.3.msbuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'c:\Users\Michael.vscode\extensions\ms-dotnettools.csharp-1.23.6.omnisharp\1.37.3.msbuild\Current\Bin\MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "c:\Users\Michael.vscode\extensions\ms-dotnettools.csharp-1.23.6.omnisharp\1.37.3.msbuild\Current\Bin"
CscToolExe = csc.exe
CscToolPath = c:\Users\Michael.vscode\extensions\ms-dotnettools.csharp-1.23.6.omnisharp\1.37.3.msbuild\Current\Bin\Roslyn
MSBuildExtensionsPath = c:\Users\Michael.vscode\extensions\ms-dotnettools.csharp-1.23.6.omnisharp\1.37.3.msbuild
MSBuildToolsPath = c:\Users\Michael.vscode\extensions\ms-dotnettools.csharp-1.23.6.omnisharp\1.37.3.msbuild\Current\Bin
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'f:\Repository\Raspberry\TestProject\Service.Device.Control'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'f:\Repository\Raspberry\TestProject\Service.Device.Control'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'f:\Repository\Raspberry\TestProject\Service.Device.Control\Service.Device.Control.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'f:\Repository\Raspberry\TestProject\Service.Device.Control'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.MSBuild.ProjectManager
Loading project: f:\Repository\Raspberry\TestProject\Service.Device.Control\Service.Device.Control.csproj
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 'f:\Repository\Raspberry\TestProject\Service.Device.Control' on host 5820.
[warn]: OmniSharp.MSBuild.ProjectLoader
Could not write lines to file "obj\Debug\netstandard2.0.NETStandard,Version=v2.0.AssemblyAttributes.cs". Access to the path "f:\Repository\Raspberry\TestProject\Service.Device.Control\obj\Debug\netstandard2.0.NETStandard,Version=v2.0.AssemblyAttributes.cs" is denied.
[warn]: OmniSharp.MSBuild.ProjectLoader
The "WriteLinesToFile" task returned false but did not log an error.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'f:\Repository\Raspberry\TestProject\Service.Device.Control\Service.Device.Control.csproj'.
f:\Repository\Raspberry\TestProject\Service.Device.Control\Service.Device.Control.csproj
c:\Users\Michael.vscode\extensions\ms-dotnettools.csharp-1.23.6.omnisharp\1.37.3.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3353,5): Error: Could not write lines to file "obj\Debug\netstandard2.0.NETStandard,Version=v2.0.AssemblyAttributes.cs". Access to the path "f:\Repository\Raspberry\TestProject\Service.Device.Control\obj\Debug\netstandard2.0.NETStandard,Version=v2.0.AssemblyAttributes.cs" is denied.
c:\Users\Michael.vscode\extensions\ms-dotnettools.csharp-1.23.6.omnisharp\1.37.3.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(3353,5): Error: The "WriteLinesToFile" task returned false but did not log an error.

Adding project 'f:\Repository\Raspberry\TestProject\Service.Device.Control\Service.Device.Control.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: Service.Device.Control
[fail]: OmniSharp.Stdio.Host
************ Response ************
{
"Request_seq": 16,
"Command": "/v2/highlight",
"Running": true,
"Success": false,
"Message": ""System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\r\nParameter name: line\r\n in Microsoft.CodeAnalysis.Text.LinePosition..ctor(Int32 line, Int32 character)\r\n in OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService.d__1.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\SemanticHighlight\\SemanticHighlightService.cs:line 36\r\n--- End of stack trace from previous location where exception was thrown ---\r\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n in OmniSharp.Endpoint.EndpointHandler2.<GetFirstNotEmptyResponseFromHandlers>d__19.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n in OmniSharp.Endpoint.EndpointHandler2.d__20.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 230\r\n--- End of stack trace from previous location where exception was thrown ---\r\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n in OmniSharp.Endpoint.EndpointHandler2.<Process>d__16.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 131\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n in OmniSharp.Stdio.Host.<HandleRequest>d__13.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Stdio\\\\Host.cs:line 215\"", "Body": null, "Seq": 56, "Type": "response" } [fail]: OmniSharp.Stdio.Host ************ Response ************ { "Request_seq": 30, "Command": "/v2/highlight", "Running": true, "Success": false, "Message": "\"System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\\r\\nParameter name: line\\r\\n in Microsoft.CodeAnalysis.Text.LinePosition..ctor(Int32 line, Int32 character)\\r\\n in OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService.<Handle>d__1.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\SemanticHighlight\\\\SemanticHighlightService.cs:line 36\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n in OmniSharp.Endpoint.EndpointHandler2.d__19.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n in OmniSharp.Endpoint.EndpointHandler2.<HandleRequestForLanguage>d__20.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 230\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n in OmniSharp.Endpoint.EndpointHandler2.d__16.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 131\r\n--- End of stack trace from previous location where exception was thrown ---\r\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n in OmniSharp.Stdio.Host.d__13.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Stdio\\Host.cs:line 215"",
"Body": null,
"Seq": 79,
"Type": "response"
}
[fail]: OmniSharp.Stdio.Host
************ Response ************
{
"Request_seq": 54,
"Command": "/v2/highlight",
"Running": true,
"Success": false,
"Message": ""System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\r\nParameter name: character\r\n in Microsoft.CodeAnalysis.Text.LinePosition..ctor(Int32 line, Int32 character)\r\n in OmniSharp.Roslyn.CSharp.Services.SemanticHighlight.SemanticHighlightService.d__1.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\SemanticHighlight\\SemanticHighlightService.cs:line 36\r\n--- End of stack trace from previous location where exception was thrown ---\r\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n in OmniSharp.Endpoint.EndpointHandler2.<GetFirstNotEmptyResponseFromHandlers>d__19.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n in OmniSharp.Endpoint.EndpointHandler2.d__20.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 230\r\n--- End of stack trace from previous location where exception was thrown ---\r\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n in OmniSharp.Endpoint.EndpointHandler`2.d__16.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 131\r\n--- End of stack trace from previous location where exception was thrown ---\r\n in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n in OmniSharp.Stdio.Host.d__13.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Stdio\\Host.cs:line 215"",
"Body": null,
"Seq": 196,
"Type": "response"
}

@stewartadam
Copy link

stewartadam commented Dec 8, 2020

Likely related to OmniSharp/omnisharp-roslyn#909

@AquariusStar
Copy link
Author

I looked at your other similar questions. This seems to be an old problem. The only thing I found in searching for a solution to the problem on various question branches is that there is a project switcher in the status bar. It works, of course. But this is a partial measure of the solution. If I jump between different projects, I will have to switch the active project for omnisharp every time and wait for the analysis to complete. I lose more time this way. Therefore, I have to work without using the configuration file.code-workspace.

@JoeRobich JoeRobich closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
@JoeRobich
Copy link
Member

Closing as support for this is being tracked by OmniSharp/omnisharp-roslyn#909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants