✅ Setting up C# in VS code

Having a issue, setting it up or whatnot? I'm not sure what the problem is.
130 Replies
Buddy
Buddy4mo ago
$vscode
MODiX
MODiX4mo ago
Follow the instructions here on getting started with DevKit for C# in VSCode: https://code.visualstudio.com/docs/csharp/get-started
Getting Started with C# in VS Code
Getting Started with C# and .NET Development in Visual Studio Code
ShadowKernelSystem32
Can you voice call?
Buddy
Buddy4mo ago
No.
ShadowKernelSystem32
Then dont comment
Buddy
Buddy4mo ago
????
333fred
333fred4mo ago
If you want help, ask questions that include relevant details?
ShadowKernelSystem32
I'm doing a module. I've got a walk through, you could take two seconds out of your time besides giving someone unneeded resourses Im getting mad because it keeps crashing my computer
Buddy
Buddy4mo ago
1. It is very rare to find someone willing to help by voice. 2. You can also take time writing more details -"it doesnt work, pls fix" is really nothing to go for.
ShadowKernelSystem32
buddy, either take a moment to look or lemme show you or go on. Thanks
Buddy
Buddy4mo ago
You made a thread in #help which is not for VC, it is help by text. You are free to upload images or videos.
ShadowKernelSystem32
Im doing that certification
333fred
333fred4mo ago
You might want to start by giving more detail. If you don't want to give more detail... maybe try a different forum that isn't about helping via text
ShadowKernelSystem32
This is the help fourm
333fred
333fred4mo ago
Yes And you have given us no details by which to help you We're not mind readers, and as you've noted, this is the help forum. Where we use text to communicate.
ShadowKernelSystem32
I've commented what I've said, I can show you better then explaining
Buddy
Buddy4mo ago
- Do you get any errors?
ShadowKernelSystem32
It's either a human factor error Can I DM you @⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲ to show or explain
Buddy
Buddy4mo ago
We do not accept DMs here.
333fred
333fred4mo ago
Why can you not just provide us details here
Buddy
Buddy4mo ago
Better getting help from +50K people than a single person, isn't it?
ShadowKernelSystem32
All right onto the next user that will be more willing to help a individual So, I'm doing the module on FreeCodeCamp Correct? For installing or setting up on VS for the certification
ShadowKernelSystem32
I was trying to run a basic program but, I'm familiar with Python so I'm not sure If I am running the program incorrect Maybe I compiled it wrong?
Buddy
Buddy4mo ago
Any errors?? How do you call to compile and launch the program? Do you have C# dev kit extension installed in your VSCode?
ShadowKernelSystem32
No I don't get the error's I was following the module and it told me to type dotnet Build into the terminal and when I do that it give's me a crash
Buddy
Buddy4mo ago
Crash that says?
ShadowKernelSystem32
What? Okay, this is the best way I know how to explain it without wasting my time at this point of night
Buddy
Buddy4mo ago
You said it gives you a crash, does it say anything when it crashes?
ShadowKernelSystem32
Closes the software/program down
tannergooding
tannergooding4mo ago
people are trying to help, please be mindful of that and don't make statements about wasting your time the inverse could equally be stated
ShadowKernelSystem32
I understand just frustration I appologize @⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲ My regards go out to you.
Buddy
Buddy4mo ago
Do you have a code example of the C# code you are trying to build?
ShadowKernelSystem32
Just compiling a simple one, like you would in .py I suppose Console.WriteLine("Hello World");
Buddy
Buddy4mo ago
Ok.
ShadowKernelSystem32
I'm working on the Foundational here, so please bare with me. It's getting late, I was trying to explain because I am tired
Buddy
Buddy4mo ago
So, dotnet build does not actually start the program. It simply just compiles it. You can run it with either dotnet run or by vscode's launch button (which requires an extension or manual configuration)
ShadowKernelSystem32
Are you allowed to run a simple command like that Ahhhhh lemme try that in the terminal One moment
Buddy
Buddy4mo ago
This extension is what was linked at the beginning. And it guides you through setting up VSCode for C# including extensions that are up-to date with Microsoft standards.
ShadowKernelSystem32
Yeah. I get this kind of error It's not a supported kind of file extention So, I was using the intergrated terminal on MS
333fred
333fred4mo ago
Copy/paste the entire terminal output From your dotnet run
ShadowKernelSystem32
Couldn't find a project to run. Ensure a project exists in C:\Users\Edwar\Desktop\General\Coding Project's\C# Experience, or pass the path to the project using --project.
333fred
333fred4mo ago
So, I'm assuming you just created a .cs file
ShadowKernelSystem32
Yes
333fred
333fred4mo ago
And didn't create a project
ShadowKernelSystem32
I'm going by the module lol
333fred
333fred4mo ago
dotnet run file.cs is a feature that is coming soon, but it does not exist yet. Well, the module tells you to create a project
ShadowKernelSystem32
lemme go back over it. One moment
333fred
333fred4mo ago
Yes. You did not do that last Exercise Exercise - Create, build, and run your application
ShadowKernelSystem32
Fred could I screen share with you
333fred
333fred4mo ago
You can screenshot I'm not joining voice
Buddy
Buddy4mo ago
C# is project-based, which means you need to create a project instead of running individual files for now
ShadowKernelSystem32
So basically, I need a actual more detailed project ran or operated
Buddy
Buddy4mo ago
You can create a project from the dotnet new command which is mentioned in https://learn.microsoft.com/en-us/training/modules/install-configure-visual-studio-code/7-exercise-create-build-run-app at the top
ShadowKernelSystem32
That's the one I was having a issue on
333fred
333fred4mo ago
So what output do you get when you run the command that module tells you to run?
ShadowKernelSystem32
I'm new to C#
333fred
333fred4mo ago
Yes, I understand that. What output do you get when you run the command that module tells you to run?
ShadowKernelSystem32
dotnet new console -o ./CsharpProjects/TestProject I entered this command into the terminal
Buddy
Buddy4mo ago
What do you see after you entered that into the terminal? Any new text being written below it?
ShadowKernelSystem32
yeah Im onto something
Buddy
Buddy4mo ago
:PauseChamp:
ero
ero4mo ago
You don't even need the terminal to create and run projects in vsc
ShadowKernelSystem32
error CS8802: Only one compilation unit can have top-level statements.
333fred
333fred4mo ago
This is probably from you creating a separate .cs file earlier You'll want to delete that one
ShadowKernelSystem32
I done that still same error
333fred
333fred4mo ago
A project collects all the files in the same folder or nested folder from your .csproj
ShadowKernelSystem32
I'm not the kind to skip a module without actually getting a understand
333fred
333fred4mo ago
Then you still have multiple files in the same folder or a nested folder from your csproj
hoggy077
hoggy0774mo ago
I see all these links to resources & really just have to wonder how ya'll got here
333fred
333fred4mo ago
Yes, you created a project in the current directory and in CSharpProjects This is messing things up
ShadowKernelSystem32
Okay, lets start from scratch
hoggy077
hoggy0774mo ago
good decision
ravindT~T
ravindT~T4mo ago
before you do that, try deleting this 👇 and run dotnet run again?
No description
ravindT~T
ravindT~T4mo ago
...that folder is what is referred to, here 👆
ero
ero4mo ago
No description
No description
ero
ero4mo ago
no need for the terminal at all
333fred
333fred4mo ago
They're following the setup tutorial, probably best to just keep following it for now
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
333fred
333fred4mo ago
No, that would not result in this output. Probably best to not make baseless speculation 🙂
ShadowKernelSystem32
I'm tapping tonight sense I cannot get anyone on Voice, my brain is fried and it's late, I will close this discusion and open one tomorrow
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
Okay, tomorrow better attitude Getting help is better then no progress Thanks everyone @⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲⇲ sorry again for my attitude
ShadowKernelSystem32
How do I get rid of the CSharp on the left
ero
ero4mo ago
right click it...?
ShadowKernelSystem32
No
333fred
333fred4mo ago
C# Experience?
ShadowKernelSystem32
Yes
333fred
333fred4mo ago
That's the folder you opened
ShadowKernelSystem32
should I there Should I leave there or close
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
All right I am determined to figure this out
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
Can someone walk me through where I am currently
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
Hang on not to fast TacoBell
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
333fred
333fred4mo ago
Alright tebeco, you know what you must do New nickname time
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
TebeCo so currently my screen is here
Accord
Accord4mo ago
You will be reminded about it in 1 day
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
Yeah basically, I was using the intergrated terminal also for C# on Microsoft Learning lets just stop here Normally when I use Python, I save it as a .py and run it and it'll run the program as long as a loop or something executiable is avalibale excuse my grammer but I want to ask even if I run the command
Console.WriteLine("Hello World!");
Console.WriteLine("Hello World!");
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
Nothing is going to display correct? Send me that personally
ero
ero4mo ago
?? just bookmark it
ShadowKernelSystem32
I guess what I should ask, I need more then hello world to be able to run a actual line in C# Thanks btw
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
you know python right?
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
How you save it as .py
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
Do I need to keep it saved as .CS or .csproj
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
No I followed a module and got lost and still am confused by it
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
Makes sense I agree Is the program suppose to be executable with just the Console.WriteLine That's my question
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
Okay tomorrow I'll @ you
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
We can start from there
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ero
ero4mo ago
yes
Unknown User
Unknown User4mo ago
Message Not Public
Sign In & Join Server To View
ShadowKernelSystem32
Okay Will do. Have a goodnight take care
Accord
Accord4mo ago
@TeBeCo
Reminder
nickname

Did you find this page helpful?