How to fix VSCode Error/Warning for valid code
Is there something I need to do in vscode to use a newer lang version or something so that it doesn't think this is an error
The code compiles but vscode syntax highlighting shows it as an error
19 Replies
maybe that you forgot
interface
?Sorry that was just me copy/pasting wrong, it’s definitely there
It’s complaining thinking ROS can’t be used in the Func but it can be since the latest C# version
should be fine since net9, see which target framework you are building for, and which sdk you are using
the csproj has net9.0
To be clear it has
looks fine, maybe something in vscode, check if the c# dev kit is updated
Try explicitly setting the language version?
I'm not using the dev kit, just the plain C# extension
That could be the issue lol
But it is up to date
As in newer features only come to the dev kit one or just it gets more attention support wise from MS?
Both
Ok, will look at submitting an issue on the extension then
Unfortunately an explicit
LangVersion
didn't help
Looks like it is ok in the dev kit so yes sounds like a bug they need to fix in the standard analyserI'm not sure they will, DevKit is the way to add .NET support to VSCode
but also with an annoying sign in requirement
Well, yeah, it uses the same licensing model as VS proper
Me, personally, $ridergang
:rider: 🇬 🇦 🇳 🇬
DevKit is marked as optional and while I agree it has new features it is documented that the plain C# extension should work just fine for normal analysis without any VS subscription
I would also love to use Rider but VSCode's remote ssh extension is miles ahead (it actually works on my host) than Rider's equivalent
GitHub
Issues · dotnet/vscode-csharp
Official C# support for Visual Studio Code. Contribute to dotnet/vscode-csharp development by creating an account on GitHub.
Welp it turns out I had
"dotnet.server.useOmnisharp": true
set in my VSCode SSH remote settings but not local so I thought I wasn't using O# but it in fact was. Removed that and things start working magically