C
C#2y ago
kuulie

❔ Setting up VSC

im trying to output some text from the terminal using Console.WriteLine() but the csc command is not outputting anything. is my VSC not set up correctly?
19 Replies
333fred
333fred2y ago
$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
phaseshift
phaseshift2y ago
Yeah, don't use CSC directly
333fred
333fred2y ago
Also, you should definitely not be using csc directly
kuulie
kuulieOP2y ago
Unable to generate assets to build and debug. OmniSharp server is not running. it says i have the C# extension installed tho
kuulie
kuulieOP2y ago
Angius
Angius2y ago
Don't use CSC, use dotnet run
333fred
333fred2y ago
Did you follow the steps? Particularly step 2?
WhiteBlackGoose
feels kinda weird that you can't open a file to get O# running omnisharp-vim allows it and I think if you run O# manually it will work it's just some quirk of particularly VSC' extension
333fred
333fred2y ago
Opening a single file is a more important scenario for vim As that's the way vim actually operates
WhiteBlackGoose
that isn't a reason why it's not done like that in VSC, tbh does it work the same for other languages? C, Rust, Java, or some other languages with project files?
333fred
333fred2y ago
Unsure about Java. Rust and C both need roots opened C is particularly bad Rust enforces a file structure from the root In the compiler itself
WhiteBlackGoose
so you can't do vscode main.rs to have its LS running?
333fred
333fred2y ago
I don't believe so I could certainly be wrong
WhiteBlackGoose
I see
333fred
333fred2y ago
Anyway, this is entirely irrelevant to the issue this thread is about 🙂
WhiteBlackGoose
I still find it weird but if it works consistently among languages... I guess, there's a reason yeah sorry
kuulie
kuulieOP2y ago
thnak you dotnet run worked
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