❔ What do I do before I write any code?
I am looking for a simple yet accurate explanation on what I am supposed to do here. Ive downloaded .NET, ive downloaded VisualStudioCode and ive installed the C# extention, what do I do next? I think I need something along the lines of a "cd" and I don't even know what that is... I'm just completely lost, someone please help. (pardon my spelling)
103 Replies
Well, using Visual Studio instead of VS Code is highly recommend for new people
If you are on windows, I highly urge you to do so
I second what Pobiega said, Visual Studio will automate a lot of the build and config work for you that VS code will simply ever do. If you're just starting out, and you're own Windows, definitely consider Visual Studio over VS code. Could you give some details on your OS, @Ryan M?
great advice
God im so thankful for discord...🤣
VS 2022, .NET SDK, ReSharper (optional but recommended) & a browser.
um
my OS?
Your operating system, Windows 10 for example.
Windows/Mac/Linux/Something else?
Windows 11
yeah then go for VS community 2022
Oh okay, that's decent for .NET development.
it will install everything else you need
https://dotnet.microsoft.com/en-us/download/visual-studio-sdks https://visualstudio.microsoft.com/ https://brave.com/VS installs the SDKs, but still.
you dont need to install the SDK on its own, and you certainly dont need Brave
wow great thanks a lot haha
You need a browser unless you're God.
Im sure Ryan has a browser or two already.
Yes, Brave was just a recommendation.
I'm not going to link all of the exisiting browsers.
Lets not dump 3 links on the rookie when a single one would have sufficed.
Does it matter though?
https://visualstudio.microsoft.com/ is all you need
one sec...
Yeah it does, you're confusing a beginner by posting your recommended browser together with things they actually need
How was that confusing though?
ok so do I download Community, Pro, or Enterprise
Community.
the others are paid
ok
Community is good.
got it
and you dont need the features they unlock anyways to be honest
community is very well featured
I have Enterprise, but I've never used any of its features.
I can't even tell the difference except for the little name tag in the top right corner.
👍
This is the only installation you'll need to choose too, for C#
While I agree that you should likely start with Visual Studio as your IDE, if you've installed the SDK and want to take the nest basic step, I recommend using the CLI to create a simple hello world program and make sure everything is working. It's as simple as:
If that successfully prints Hello, World then you know everything is good to go. Now you can open the .csproj file tht was created in VS and start coding.
that's great
I just want to make sure if there's anything important I need to know at this step here:
As SWR said, just the ".NET Desktop development" workload is needed
right
Depending on what you want to do, you might have to install other dependencies. But that one should do for now.
yeah you can always come bakc and add more later
For example, you need ASP.NET for ASP.NET.
What kind of programs are you planning on building?
ok so I click on that, and then ready to install?
Yeah.
coolcool
If you want to create something else like a web application you can always come back and tick that one as well.
um
yeah, I got that
just, can you give me an example of a web application?
... Sorry im kinda hooked on to yall here😆
ok never mind I got it
I know what a web application is
wat
Just an example.
oh ok
got it
yeah this installation is likely gonna take another 15-20 mins so we otta wait
Yep.
I agree with the first comments when i was new i lost my mind on visual studio Code . Visual studio is much better for new users.
Agreed, VSC debugging is horrible.
it takes two button presses to set up VS Code debugging. much less time than it is taking to install Visual Studio
Hey guys, I, sorry I was out for a bit... Anyways, I think i've gotten everything setup, I copy and pasted this code:
Console.WriteLine("Hello, World!");
dotnet new console --name HelloWorld
cd HelloWorld
dotnet run
and I got this:
not sure what's missing here
These are supposed to be commands you run from a command line terminal, not C# source code.
That was to test that the SDK was working without using Visual Studio
Like, from a PowerShell window
how exactly can I find the command line terminal?
Do you know how to use the command line at all?
I don't even know what "the command line" is refering to
I'm sorry🤣
(pardon my spelling)
If you have Visual Studio installed, you do not need to use the command line
Can you send a full screen shot?
sure
its my first project on this account
It's this thing.
Easier to use than Visual Studio to get a project up and running, but if you aren't comfortable at all using a Command LIne Interface then maybe stick to Visual Studio.
ok well I don't even know the difference
seems like command line is just another interface to write code in
remove lines 6-8
ok
In the menu, go to Build
Then build (either Ctrl+B or F6)
ok
it says "build succeeded" at the bottum left
how is the "build" fuction significant?
why should I have done it this time?
what did it do
It actually builds your text source code into a runnable application
oh
In the menu, go to Debug, and choose Run and Debug, or Run without Debugging
either is fine
Ok so it gave me this
huzzah
You did it
You built and ran your first C# program
Hopefully not your last.
yah
Going forward, I strongly suggest this as your way of building programs in C#.
Much more new-user-friendly than using command line
right
thanks
just one more thing
canu tell me whats wrong with this?
Lines 5-7 are not C# code
o o
They're commands you would put in a command line interpreter to build your C# program and run it
If you do not understand it, that's fine, but it's another reason you should ignore it for now.
ok
I believe mtreit gave you those commands, not understanding your CLI experience. I recommend disregarding it for now.
yeah so far, this is seeming much more complicated than python
As you become more comfortable with programming, you can look into CLIs again
It's an exchange
ok
for what
I do C++, C#, and python heavily. They're all equally easy to build and debug (except C++) once you get used to it.
ok then
I'm super thankful I have access to this community, I can't thank all of it, so I'm gonna have to just say thank you for now
all good
happy to help
When I started, discord didn't exist
There was a lot more suffering
yeah🤣
Play with C# in visual studio for a while. I think you'll grow to like it.
Reach out if you have any more questions. Feel free to ping (just don't overdo it)
perhaps when I learn a good foundation...
anyways, im gonna go watch some programming with mosh
bye
When I started stack overflow didn't exist 👴
did time even exist back then?
nor youtube did
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.