C# First startup — How to get started

M1RaGe
3 min readMar 8, 2021

Today I’m going to help you how to start up your C# for the first time and explain some of the things you’ll see after you launch to get things clear. First, you need to download Microsoft Visual Studio which you can get HERE for free. Applications written in C# use the .NET Framework, so it makes sense to use Visual Studio, as the program, the framework, and the language, are all created by Microsoft.

After the installation, you’ll see a lot of things called “Workloads”, here you have to select the .NET desktop development under the “Desktop and Mobile”, then proceed to begin downloading by hitting “Modify”. It’ll a take period of time so just be patient . After the installation is complete, you can open up Visual Studio to get started.

Now you can create your first project by clicking “Create New Project” and selecting the Console App (.NET Framework) option at the right side of the screen. If you struggling to find it you can use the search bar at the top.

Image of Visual Studio’s “Modyfying” screen
Project Creation

If you click create, after a short loading screen your project will appear with a few lines of codes for example class Program, static void Main and the last one with the sentence “Hello World!” in it. All of these are auto-generated everytime you create a project. We’ll mostly work in the area between the two braces of the static void Main ignoring the external area. Now let’s see what can we do with it!

The First Thing That Comes In Front Of To Your Eyes

The Console.Writeline is a predefined class used to print data into the console output screen which you can access by runnig your code with the green triangle button “Start” at the top or just by pressing F5 on your keyboard. Noticed that nothing happened? Well It’s because the code ran so fast and closed before you could even see it. Don’t worry. We can fix it, just hit enter and type Console.Readkey(); then click save. What this does is if you open your code it won’t close until you press a button on your keyboard.

Now if you run yor code again you can see the console screen and the sentence “Hello World!” in the first line. Press ESC (or anything else) to close it and get back to the coding section. If you want you can replace this lame Hello World sentence to something more interesting, it’s all up to you, just don’t forget to save it before running it!

And that’s all for today, I hope we’ll meet next time where I’m going to talk about comments and variables. Until then stay safe!

--

--

M1RaGe

high school student sharing thoughts and helping out beginners in programming :3