So, you’ve decided to explore .NET Core—great choice! Whether you're coming from .NET Framework or are completely new to Microsoft’s ecosystem, this guide will help you set up, build, and run your first .NET Core application. Let’s get started!
Before we dive into coding, let’s talk about why .NET Core is worth learning:
✔ Cross-platform (Windows, Linux, macOS)
✔ High performance (faster than traditional .NET Framework)
✔ Open-source (hosted on GitHub, community-driven)
✔ Modern & modular (perfect for microservices, cloud apps, and APIs)
If you want to build scalable, high-performance apps, .NET Core is a fantastic choice.
To start coding, you’ll need the .NET SDK (Software Development Kit). Here’s how to get it:
dotnet --version
Now, let’s build something simple. We’ll start with a console app (the "Hello World" of coding).
Run this command:
dotnet new console -o HelloWorld cd HelloWorld
This creates a new .NET Core console project in a folder called HelloWorld
.
Inside the HelloWorld
folder, you’ll see a Program.cs
file. Open it—it should look like this:
Console.WriteLine("Hello, World!");
Now, run the app:
dotnet run
Output:
Hello, World!
Congratulations! You just ran your first .NET Core app. 🎉
Let’s tweak the code to make it interactive. Change Program.cs
to:
Console.Write("What's your name? "); string name = Console.ReadLine(); Console.WriteLine($"Hello, {name}! Welcome to .NET Core! 🚀");
Run it again (dotnet run
) and type your name. Now it greets you personally!
Want to try something more exciting? Let’s build a web app in seconds!
Run:
dotnet new webapp -o MyFirstWebApp cd MyFirstWebApp dotnet run
Now, visit http://localhost:5000 in your browser. Boom! You’ve got a running web app.
You’ve just scratched the surface. Here’s where to go from here:
You’ve officially started your .NET Core journey! 🎯
"The expert in anything was once a beginner. Keep coding, keep learning!"
👉 What’s your next step? Drop a comment below—let’s build something awesome together! 🚀
Want more? Let me know if you'd like a deeper dive into web apps, APIs, or cloud deployment! 🔥