C
C#2y 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
SG972y ago
how did you set it up the solution/project
Poroli
PoroliOP2y 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 👻 🎃
you can install omnisharp for that @Poroli $vscode
MODiX
MODiX2y 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
PoroliOP2y 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 👻 🎃
@🌈 Thinker 🌈 maybe you can help, your the only one using vscode I know 😄
Poroli
PoroliOP2y ago
When I want to Generate assets, it says that Omnisharp server is not running
x0rld 👻 🎃
have you open a folder or a file ?
Poroli
PoroliOP2y 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 👻 🎃
it may be cause of that
Poroli
PoroliOP2y ago
I thought that was that but I next created a folder and it still doesn't work
x0rld 👻 🎃
re open it as a folder
Thinker
Thinker2y ago
As a general rule, when creating a new project you should be using dotnet new, not just creating .cs files.
Poroli
PoroliOP2y ago
Okay I see
Thinker
Thinker2y ago
C# is project-based, which means that every project needs a .csproj file at its root
Poroli
PoroliOP2y ago
I'll try tomorrow
Angius
Angius2y 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
Accord2y 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.
Want results from more Discord servers?
Add your server