ssukhpinder

Sukhpinder Singh

Posted on May 23, 2021

Begin with C#

C# has been around for quite some period, and it continues to develop, obtaining more enhanced features.

Learning Objective

  • How to install Visual Studio

  • How to write your first C# program

Prerequisites

The article is beginner level, so previous coding experience is not required.

Getting Started

C# is an object-oriented programming language which allows developers to build various kinds of reliable and healthy applications.

Programming language C# is used to develop following applications

  • Desktop based application: For example WinForms, WPF and many more.

  • Mobile based applications: using Xamarin cross platform development.

  • Web applications: using ASP.Net MVC and ASP.Net Core MVC.

  • Web services: via ASP.Net Web API, ASP.Net Core Web API and WCF services.

  • Games: Unity framework

  • and much more.

Software Dependency

To begin, go to VisualStudio.com and download the free community 2019 edition. The visual studio IDE supports multiple programming language template, choose required components.

For example, for C# development for console and web application, select the below-highlighted components.

For .Net Core cross-application development, select the following module.

After selection, install the Visual Studio IDE and follow the below steps to write the first C# “Hello World” program.

Hello world Console Application

Open visual studio and go to menu item File > New > Project and select console application(.Net Framework)

Click Next, and visual studio will create a console application template. Write the following code to write “Hello World” inside the main method, which outputs the same message in the console window.

class Program
{
  static void Main(string[] args)
  {
    Console.WriteLine("Hello World!");    
  }
}
Enter fullscreen mode Exit fullscreen mode

Run/Debug

Now hit the play button on the IDE menu or hit the F5 key to run the program in debug mode.

To run things quicker, hit “Ctrl + F5” and run the program in release mode.

Thank you for reading, and I hope you liked the article. Please provide your feedback in the comment section.

Follow on following channels to stay tuned on upcoming stories on C#

C# Publication, LinkedIn, Instagram, Twitter, Dev.to, Pinterest, Substack, Wix

💖 💪 🙅 🚩
ssukhpinder
Sukhpinder Singh

Posted on May 23, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Begin with C#
csharp Begin with C#

May 23, 2021