Closed WebFreak001 closed 2 years ago
updating Visual Studio (not vscode) has fixed this for some reason.
I don't know what Omnisharp has to do with VS but seems like that fixed it.
OmniSharp tries to use MSBuild from Visual Studio if Visual Studio is installed on your machine.
It was visible in your logs as:
Registered MSBuild instance: Visual Studio Professional 2019 16.9.31129.286 16.9.0 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin"
Issue Description
Same issue as #3290, but now with dotnet 6.0
Steps to Reproduce
Install dotnet 6.0, create a new console app through
dotnet new console
, open the projectExpected Behavior
Auto completion and everything should still work
Actual Behavior
All builtin types, System usings and even string literals get red squiggly lines under them, making the code unreadable. Autocompletion does not work properly.
The error on the first using line has error CS0246
Building and command line dotnet invocations still work fine.
Logs
OmniSharp log
C# log
none
Environment information
VSCode version: 1.62.3 C# Extension: 1.23.17
Dotnet Information
.NET SDK (gem�� "global.json"): Version: 6.0.100 Commit: 9e8b04bbff Laufzeitumgebung: OS Name: Windows OS Version: 10.0.19043 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.100\ Host (useful for support): Version: 6.0.0 Commit: 4822e3c3aa .NET SDKs installed: 3.1.101 [C:\Program Files\dotnet\sdk] 3.1.402 [C:\Program Files\dotnet\sdk] 5.0.201 [C:\Program Files\dotnet\sdk] 6.0.100 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.0 [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| |---|---|---| |arm|dan-c-underwood|1.5.2| |blamer-vs|beaugust|0.5.2| |code-d|webfreak|0.23.2| |cpptools|ms-vscode|1.7.1| |csharp|ms-dotnettools|1.23.17| |cursor-align|yo1dog|1.1.0| |cursorCharCode|zeithaste|0.2.0| |debug|webfreak|0.25.1| |docomment|k--kato|0.1.30| |gitlens|eamodio|11.7.0| |hex-fmt|keroc|1.0.0| |hex-hover-converter|maziac|1.2.1| |jupyter|ms-toolsai|2021.10.1101450599| |jupyter-keymap|ms-toolsai|1.0.0| |jupyter-renderers|ms-toolsai|1.0.4| |linkerscript|ZixuanWang|1.0.2| |materialdesignicons-intellisense|lukas-tr|4.0.0| |matlab|Gimly81|2.2.1| |nsis|idleberg|3.45.0| |palette-support|dqisme|1.0.0| |plantuml|jebbs|2.16.1| |python|ms-python|2021.11.1422169775| |reg|ionutvmi|1.0.3| |remote-wsl|ms-vscode-remote|0.58.5| |roslynator|josefpihrt-vscode|3.3.0| |sqltools|mtxr|0.23.0| |sqltools-driver-mysql|mtxr|0.2.0| |svn-scm|johnstoncode|2.15.0| |synthwave-vscode|RobbOwen|0.1.10| |test-adapter-converter|ms-vscode|0.1.4| |vscode-css-peek|pranaygp|4.2.0| |vscode-hexdump|slevesque|1.8.1| |vscode-jsp|pthorsson|0.0.3| |vscode-lldb|vadimcn|1.6.10| |vscode-nxunit-test-adapter|wghats|0.1.3| |vscode-proto3|zxh404|0.5.5| |vscode-pylance|ms-python|2021.12.0| |vscode-test-explorer|hbenl|2.21.1| |vscode-text-pastry|jkjustjoshing|1.3.1| |vt100-syntax-highlighting|Tobias-Faller|1.0.1| |xml|DotJoshJohnson|2.5.1|;I tried deleting
~/.vscode/extensions/ms-dotnettools.csharp-1.23.17
and reinstalling as suggested in https://github.com/OmniSharp/omnisharp-vscode/issues/2147#issuecomment-378289443 but it didn't fix it