Creating Your First .NET Application
In this section, we will walk you through the process of creating your first .NET application. We will start with a simple console application that prints "Hello, World!" to the console.
To begin, open your preferred integrated development environment (IDE) and follow these steps:
- Create a new project: Select the option to create a new .NET console application project.
- Choose a name for your project: Give your project a meaningful name, such as "MyFirstNETApp".
- Write the code: Replace the existing code in the
Program.cs
file with the following code:
TEXT/X-CSHARP
1using System;
2
3namespace MyFirstNETApp
4{
5 class Program
6 {
7 static void Main(string[] args)
8 {
9 Console.WriteLine("Hello, World!");
10 }
11 }
12}
- Build and run the application: Build the project and run the application. You should see the output "Hello, World!" in the console.
Congratulations! You have successfully created your first .NET application. This is just the beginning of your journey into the world of .NET programming.
xxxxxxxxxx
12
using System;
namespace MyFirstNETApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment