Open DrewRidley opened 3 years ago
Please describe the problem you are seeing as specified in the issue template. Thanks.
The problem I am having is that OmniSharp does not load, and does not provide code analysis on the files. I would expect it to load successfully, but it does not. As for reproducing it, I am not really sure at this moment of a strategy but I would assume it has to do with my project or the fact that I am using vscode insiders.
according to the logs, the project file seems to be invalid
[warn]: OmniSharp.MSBuild.ProjectLoader
Project dependency Newtonsoft.Json does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
[warn]: OmniSharp.MSBuild.ProjectLoader
Package 'Newtonsoft.Json 3.5.8' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0'. This package may not be fully compatible with your project.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file 'e:\Projects\HQBot\HQBot.csproj'.
e:\Projects\HQBot\HQBot.csproj
e:\Projects\HQBot\HQBot.csproj(0,0): Error: Project dependency Newtonsoft.Json does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
e:\Projects\HQBot\HQBot.csproj(0,0): Error: Package 'Newtonsoft.Json 3.5.8' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0'. This package may not be fully compatible with your project.
Issue Description
Steps to Reproduce
Expected Behavior
Actual Behavior
Logs
OmniSharp log
OmniSharp server started. Path: c:\Users\Drew.vscode-insiders\extensions\ms-dotnettools.csharp-1.23.8.omnisharp\1.37.5\OmniSharp.exe PID: 1144
Try updating Visual Studio 2019 installation with .NET Core SDK to enable better MSBuild support.
e:\Projects\HQBot\HQBot.csproj e:\Projects\HQBot\HQBot.csproj(0,0): Error: Project dependency Newtonsoft.Json does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results. e:\Projects\HQBot\HQBot.csproj(0,0): Error: Package 'Newtonsoft.Json 3.5.8' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework 'net5.0'. This package may not be fully compatible with your project.
{ "Request_seq": 6, "Command": "/v2/getcodeactions", "Running": true, "Success": false, "Message": "\"System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.\r\nParameter name: index\r\n at Microsoft.CodeAnalysis.Text.SourceText.LineInfo.get_Item(Int32 index)\r\n at OmniSharp.Extensions.TextExtensions.GetPositionFromLineAndOffset(SourceText text, Int32 lineNumber, Int32 offset) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn\\Extensions\\TextExtensions.cs:line 26\r\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.BaseCodeActionServiced10.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\Refactoring\\V2\\BaseCodeActionService.cs:line 91\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.GetCodeActionsService.d 1.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\Refactoring\\V2\\GetCodeActionsService.cs:line 32\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Endpoint.EndpointHandlerd20.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 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at 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 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Stdio.Host.d__13.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Stdio\\Host.cs:line 215\"",
"Body": null,
"Seq": 35,
"Type": "response"
}
2.GetTextSpan(ICodeActionRequest request, SourceText sourceText) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Refactoring\\\\V2\\\\BaseCodeActionService.cs:line 124\\r\\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.BaseCodeActionService
2.2.<GetFirstNotEmptyResponseFromHandlers>d__19.MoveNext()\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.C# log
N/A (empty).
Environment information
VSCode version: 1.53.0-insider C# Extension: 1.23.8
Dotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.102 Commit: 71365b4d42 Runtime Environment: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.102\ Host (useful for support): Version: 5.0.2 Commit: cb5f173b96 .NET SDKs installed: 5.0.102 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |csharp|ms-dotnettools|1.23.8| |docomment|k--kato|0.1.20| |even-better-toml|tamasfe|0.10.0| |remote-wsl|ms-vscode-remote|0.53.2| |reui|barrsan|1.1.4| |rust|rust-lang|0.7.8|;