Open 50Wliu opened 2 years ago
@50Wliu We will need to take a new O# build to resolve this since we are currently shipping with a 4.0.0 Roslyn. As a workaround you can set your omnisharp.path
setting to latest
and that will pull an updated O# for you, however it will continually update you with the rolling build.
I'm still getting this issue today. Downgrading .NET SDK and runtime from 7.0 to 6.0 seems to resolve it.
Issue Description
Given certain code snippets, Omnisharp will reliably throw a
System.Reflection.ReflectionTypeLoadException
forMicrosoft.CodeAnalysis.CSharp, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(could not load file or assembly).Steps to Reproduce
Seems to be as simple as
and placing your cursor at the beginning of the word
test
and asking for code actions. Placing the cursor elsewhere, such as inside theint
orList
, works as expected. It's only when it's on the wordtest
that it's an issue. This is a .NET 6 project with nullability enabled.Expected Behavior
Code actions to be returned.
Actual Behavior
No code actions; OmniSharp gives an error response.
Logs
OmniSharp log
My logs are on trace, so that won't work. Here's the startup logs and the full message instead.
C# log
It's blank.
Environment information
VSCode version: 1.63.2 C# Extension: 1.24.0
Dotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.200-preview.22055.15 Commit: a3c3a2bf3b Runtime Environment: OS Name: Windows OS Version: 10.0.22544 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.200-preview.22055.15\ Host (useful for support): Version: 6.0.1 Commit: 3a25a7f1cc .NET SDKs installed: 5.0.404 [C:\Program Files\dotnet\sdk] 6.0.200-preview.22055.15 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.1 [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| |---|---|---| |azure-account|ms-vscode|0.9.11| |azure-pipelines|ms-azure-devops|1.195.0| |azurerm-vscode-tools|msazurermtools|0.15.5| |blazorwasm-companion|ms-dotnettools|1.1.0| |codesnap|adpyke|1.3.4| |cpptools|ms-vscode|1.7.1| |csharp|ms-dotnettools|1.24.0| |debugger-for-edge|msjsdiag|1.0.15| |EditorConfig|EditorConfig|0.16.4| |hexeditor|ms-vscode|1.9.4| |jupyter|ms-toolsai|2021.11.1001550889| |jupyter-keymap|ms-toolsai|1.0.0| |jupyter-renderers|ms-toolsai|1.0.4| |material-theme|zhuangtongfa|3.13.16| |powershell|ms-vscode|2021.12.0| |python|ms-python|2021.12.1559732655| |remote-containers|ms-vscode-remote|0.209.6| |remote-ssh|ms-vscode-remote|0.70.0| |remote-ssh-edit|ms-vscode-remote|0.70.0| |remote-wsl|ms-vscode-remote|0.63.13| |sarif-viewer|MS-SarifVSCode|3.1.1| |theme-bluloco-light|uloco|3.5.0| |vscode-azdo-codereview|Microsoft|1.2021.827002| |vscode-bicep|ms-azuretools|0.4.1124| |vscode-dotnet-runtime|ms-dotnettools|1.5.0| |vscode-edge-devtools|ms-edgedevtools|1.4.2| |vscode-eslint|dbaeumer|2.2.2| |vscode-power-mode|hoovercj|2.2.0| |vscode-remote-extensionpack|ms-vscode-remote|0.21.0| |vscode-research|albertborges|210806.0.2| |vscode-theme-onelight|akamud|2.2.3| |vsliveshare|ms-vsliveshare|1.0.5273| |vulnerability-extension|devprod|1.2022.126001| |wavework|Microsoft|1.2022.118003|;