✅ VS Code C# Highlighting?
In the official extension for VS Code, it looks like the highlighting would match Visual Studio's. However, it doesn't for me. Does it work for you?

43 Replies
reality:

specifically, the Console should be green/teal and WriteLine should be off yellow
do you have a solution open?
and yes it is supposed to work
I created a new directory and did
dotnet new console --use-program-main

so you don't have a solution open
it appears not. I didn't even know that was a thing
it's a single project, does it require a solution? not familiar with that
have you done any c# before this?
yes
all in VS though
usually solution creation is step 1
vs requires a solution as well
weird. okay. does that fix the highlighting? I'll give it a shot
yes, the devkit goes off of which solution you have open
and the projects in that solution are the ones that get analysis
okay. when I click open solution it doesn't give the option to create a new one. is that part of
dotnet new
and I just didn't follow directions?the devkit is capable of generating the solution automatically, but only when you have a "proper" workspace open (aka not multiple directories with unrelated projects like you have now)
dotnet new sln
and dotnet sln add
, thoughthank you so much for helping
always check out
dotnet new -h
and dotnet sln -h
also dotnet new list
thanks 🙂
look up slngen for the sake of your future sanity
(i've never needed this in my life)
your loss
i think it's yours, actually :p
needing some extra tool
well I can create a solution for the projects I want with one command
well i already have all the solution files and don't need to generate anything
and if I only want a single project, it would figure out and add all of its references automatically
merging solution files becomes a piece of cake too
just rerun the command to recreate it
not even bother with its idiotic syntax
"merging solution files"? can't say i've ever had to do something like that
if a PR adds a new project, with master having a new one already, the PR branch would have to rebase
so you do end up having to merge them
sometimes
a new project of the same name as an existing project?
or what do you mean
you just do
dotnet sln add
idk what the issue is
the one thing i will say though is that it's very frustrating that vscode is so behind on adding slnx supportwell you have to manually know what to add if it's a solution containing all the projects
and it might have dependencies
you add the project that's missing
?
with slngen you can wildcard recursively and make it figure out dependencies
solution files are simply more than just project aggregators
with the tool you just don't bother looking at that at all
you just run a command
and get back an up to date thing
not the way I use them
yeah same with
dotnet sln add
, you also just run a commandso it works for me
it can't wildcard
you have to give it the path
you run it once per project, it's really not a big deal
and you have to call it one by one for each project
plus in ides like rider and vs, the project is added to the sln automatically upon creation
yes, but it is annoying
even in vscode
I'd rather not have to deal with it
well i mean it's definitely a non-issue, but by all means, include solution files in your gitignore and confuse your contributors
I keep them exactly for this reason
so that tool is not required
But I use it for myself constantly
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View