C
C#15mo ago
Poroli

✅ No IntelliSense in VSCode

Hey, my VSCode is lacking of IntelliSense when I code in C#. I tried everything, I'm full of despair right now
19 Replies
SG97
SG9715mo ago
how did you set it up the solution/project
Poroli
Poroli15mo ago
I created a .cs file and opened it with VSC But a friend helped me with my issus and I have now a Program.cs and a .csproj
x0rld
x0rld15mo ago
you can install omnisharp for that @Poroli $vscode
MODiX
MODiX15mo ago
1) Install the C# extension 2) 2.a) DO NOT USE OPEN FILE 2.b) Always use Open Folder (from the File menu), and open the folder containing your sln file (or the folder containing the csproj if you have only one csproj) 3) To make the extension start and detect C#, either: 3.a) wait for the prompt that will appear on the bottom right of your screen that ask you if you want it to create some files, and say Yes 3.b) Command Palette (F1 or Ctrl+Shift+P) and type > .Net : Generate Assets for build and run 4) you should see a flame on the Status bar with the Omnisharp logo (see second attached screenshot) 5) it should load to finally say OmniSharp server is running (if not ask for help) https://media.discordapp.net/attachments/569261465463160900/1006652191689429022/unknown.png https://cdn.discordapp.com/attachments/569261465463160900/951015732769079336/unknown.png
Poroli
Poroli15mo ago
Normally, Omnisharp is installed w/ the C# extension but on my VSCode, that's not the case and it looks like it doesn't work Like I have Omnisharp settings
x0rld
x0rld15mo ago
@🌈 Thinker 🌈 maybe you can help, your the only one using vscode I know 😄
Poroli
Poroli15mo ago
When I want to Generate assets, it says that Omnisharp server is not running
x0rld
x0rld15mo ago
have you open a folder or a file ?
Poroli
Poroli15mo ago
I don't know, I'm not at home rn But I think this was a file As I said, I just created a .cs file and opened it w/ VSCode
x0rld
x0rld15mo ago
it may be cause of that
Poroli
Poroli15mo ago
I thought that was that but I next created a folder and it still doesn't work
x0rld
x0rld15mo ago
re open it as a folder
Thinker
Thinker15mo ago
As a general rule, when creating a new project you should be using dotnet new, not just creating .cs files.
Poroli
Poroli15mo ago
Okay I see
Thinker
Thinker15mo ago
C# is project-based, which means that every project needs a .csproj file at its root
Poroli
Poroli15mo ago
I'll try tomorrow
Angius
Angius15mo ago
And once the project is there, always open it by the .csproj or .sln (if applicable) file. Don't open the folder or singular .cs files
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.