✅ 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
how did you set it up
the solution/project
Create a .NET console application using Visual Studio Code - .NET
Learn how to create a .NET console application using Visual Studio Code and the .NET CLI.
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
you can install omnisharp for that @Poroli
$vscode
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.pngNormally, 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
@🌈 Thinker 🌈 maybe you can help, your the only one using vscode I know 😄
When I want to Generate assets, it says that Omnisharp server is not running
have you open a folder or a file ?
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
it may be cause of that
I thought that was that but I next created a folder and it still doesn't work
re open it as a folder
As a general rule, when creating a new project you should be using
dotnet new
, not just creating .cs
files.Okay I see
C# is project-based, which means that every project needs a
.csproj
file at its rootI'll try tomorrow
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
filesWas 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.