Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This tutorial teaches you how to create and run your first .NET app using file-based apps. You write a simple app and see the results of running your code.
In this tutorial, you:
- Launch a GitHub Codespace with a .NET development environment.
- Create your first .NET app.
- Run your app.
Prerequisites
You must have one of the following options:
- A GitHub account to use GitHub Codespaces. If you don't already have one, you can create a free account at GitHub.com.
- A computer with the following tools installed:
- The .NET 10 SDK.
- Visual Studio Code.
- The C# DevKit.
Open Codespaces
To start a GitHub Codespace with the tutorial environment, open a browser window to the tutorial codespace repository. Select the green Code button, and the Codespaces tab. Then select the + sign to create a new Codespace using this environment.
Create and run your first app
When your codespace loads, create a new file in the
tutorialsfolder namedhello-world.cs.Open your new file.
Type or copy the following code into
hello-world.cs:Console.WriteLine("Hello, World!");In the integrated terminal window, make the
tutorialsfolder the current folder, and run your app:cd tutorials dotnet hello-world.cs
You ran your first .NET app. It's a simple app that prints the message "Hello, World!" It uses the Console.WriteLine method to print that message. Console is a type that represents the console window. WriteLine is a method of the Console type that prints a line of text to that text console.
Congratulations! You created a simple .NET application.
Cleanup resources
GitHub automatically deletes your Codespace after 30 days of inactivity. If you plan to continue with .NET tutorials, you can leave your Codespace provisioned. If you're ready to download the .NET SDK to your computer, you can delete your Codespace. To delete your Codespace, open a browser window and navigate to your Codespaces. You should see a list of your codespaces in the window. Select the three dots (...) in the entry for the tutorial codespace and select delete.
Next steps
Get started developing .NET applications by following a step-by-step tutorial or by watching .NET 101 videos on YouTube.