✅ how do i install C# into visual studio
im tryna learn c# but idk how to make a cs file whenever i want to
32 Replies
Not entirely sure what you're asking.
When you install Visual Studio just choose .NET Development as one the workloads.
Assuming you mean Visual Studio and not Visual Studio Code.
no vsc
what i meant
is like how to make vsc make files like these
i installed it a long ago
I usually use
dotnet new console --name MyConsoleApp
in a terminal window to create a new project.and is the code supposed to work wit only 1 line?
Yes, recent versions of C# introduced a feature called "top level statements" that is supposed to make it more user friendly for beginners. Although in practice it seems to just confuse people.
while its in another hard
$vscode
Follow the instructions here on getting started with DevKit for C# in VSCode: https://code.visualstudio.com/docs/csharp/get-started
Get started with C# and .NET in Visual Studio Code
Getting Started with C# and .NET Development in Visual Studio Code
BTW if you want the old style that has a namespace and class and Main method you can do this:
Make sure in VSCode that you open the folder containing the csproj
Don't use Open File, use Open Folder.
Also, try to avoid special characters like
#
in your pathsis this normal?
Looks normal
I think
I don't ever run programs from in VSCode
all of this is required for just 1 line of code?
im so confused
C# isn't a scripting language where you just feed your .py file to a program.
You are building an assembly (DLL) file and that process requires compiling all of your source code files.
The stuff under obj is temporary stuff that the compiler produces.
As part of the compilation process.
You can generally ignore that.
so basically i just ignore it
Yeah, use a .gitignore file.
So you don't check that stuff in to source control.
but is there a way to remove the orange lines?
this one
how if i may ask
You can type the path to the program in the terminal and it will run without the build output, if you've already compiled it.
dont understand
That's if you just want to run the program directly.
Without debugging it or rebuilding it
If you start it under the debugger in VSCode I think you will probably see a bunch of output from the build and whatnot as well as the output from your program.
There are probably ways to tell it to use a separate terminal window for the program but I don't use VSCode enough to say.
ooh
ok thanks man
sorry for wasting ur time
Good luck learning C#!
thank u man
im watching bro codes c# full course
theni will do a bit of stuff with it then go to unity
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View